From 0cf91ec02205676e898fb1d6a2f8b698a0c9a2a1 Mon Sep 17 00:00:00 2001 From: Mateus Picoloto Date: Thu, 7 Dec 2023 17:40:59 -0300 Subject: [PATCH] fix: remove call to newer magento versions functionalities --- Block/Adminhtml/Form/Field/CreditCardPspField.php | 7 ++----- Block/Adminhtml/Form/Field/GatewayField.php | 7 ++----- Block/Adminhtml/Form/Field/InstallmentsNumber.php | 7 ++----- Block/Adminhtml/Form/Field/SoftDescriptor.php | 7 ++----- .../Adminhtml/Form/Fieldset/CreditCardGatewayFieldset.php | 7 ++----- Block/Adminhtml/Form/Fieldset/CustomPaymentFieldset.php | 7 ++----- .../Adminhtml/System/Config/Form/Field/HubIntegration.php | 6 ++---- Model/Graphql/PixDataProvider.php | 7 +++++++ 8 files changed, 21 insertions(+), 34 deletions(-) diff --git a/Block/Adminhtml/Form/Field/CreditCardPspField.php b/Block/Adminhtml/Form/Field/CreditCardPspField.php index 435bed76..d4402844 100644 --- a/Block/Adminhtml/Form/Field/CreditCardPspField.php +++ b/Block/Adminhtml/Form/Field/CreditCardPspField.php @@ -5,7 +5,6 @@ use Magento\Backend\Block\Template\Context; use Magento\Config\Block\System\Config\Form\Field; use Magento\Framework\Data\Form\Element\AbstractElement; -use Magento\Framework\View\Helper\SecureHtmlRenderer; use Pagarme\Pagarme\Model\Account; use Pagarme\Pagarme\Model\PagarmeConfigProvider; @@ -20,15 +19,13 @@ class CreditCardPspField extends Field * @param Context $context * @param Account $account * @param array $data - * @param SecureHtmlRenderer|null $secureRenderer */ public function __construct( Context $context, Account $account, - array $data = [], - ?SecureHtmlRenderer $secureRenderer = null + array $data = [] ) { - parent::__construct($context, $data, $secureRenderer); + parent::__construct($context, $data); $this->account = $account; } diff --git a/Block/Adminhtml/Form/Field/GatewayField.php b/Block/Adminhtml/Form/Field/GatewayField.php index fbdcb808..d8fb185d 100644 --- a/Block/Adminhtml/Form/Field/GatewayField.php +++ b/Block/Adminhtml/Form/Field/GatewayField.php @@ -5,7 +5,6 @@ use Magento\Backend\Block\Template\Context; use Magento\Config\Block\System\Config\Form\Field; use Magento\Framework\Data\Form\Element\AbstractElement; -use Magento\Framework\View\Helper\SecureHtmlRenderer; use Pagarme\Pagarme\Model\Account; class GatewayField extends Field @@ -25,16 +24,14 @@ class GatewayField extends Field * @param Account $account * @param string $paymentMethodName * @param array $data - * @param SecureHtmlRenderer|null $secureRenderer */ public function __construct( Context $context, Account $account, string $paymentMethodName = '', - array $data = [], - ?SecureHtmlRenderer $secureRenderer = null + array $data = [] ) { - parent::__construct($context, $data, $secureRenderer); + parent::__construct($context, $data); $this->account = $account; $this->paymentMethodName = $paymentMethodName; } diff --git a/Block/Adminhtml/Form/Field/InstallmentsNumber.php b/Block/Adminhtml/Form/Field/InstallmentsNumber.php index 3a88a5f9..9fd93db0 100644 --- a/Block/Adminhtml/Form/Field/InstallmentsNumber.php +++ b/Block/Adminhtml/Form/Field/InstallmentsNumber.php @@ -6,7 +6,6 @@ use Magento\Config\Block\System\Config\Form\Field; use Magento\Config\Model\ResourceModel\Config\Data\CollectionFactory; use Magento\Framework\Data\Form\Element\AbstractElement; -use Magento\Framework\View\Helper\SecureHtmlRenderer; use Pagarme\Pagarme\Model\Account; use Pagarme\Pagarme\Model\PagarmeConfigProvider; @@ -22,16 +21,14 @@ class InstallmentsNumber extends Field * @param CollectionFactory $configCollectionFactory * @param Account $account * @param array $data - * @param SecureHtmlRenderer|null $secureRenderer */ public function __construct( Context $context, CollectionFactory $configCollectionFactory, Account $account, - array $data = [], - ?SecureHtmlRenderer $secureRenderer = null + array $data = [] ) { - parent::__construct($context, $data, $secureRenderer); + parent::__construct($context, $data); $this->configCollectionFactory = $configCollectionFactory; $this->account = $account; } diff --git a/Block/Adminhtml/Form/Field/SoftDescriptor.php b/Block/Adminhtml/Form/Field/SoftDescriptor.php index cf52e3d4..aeefd603 100644 --- a/Block/Adminhtml/Form/Field/SoftDescriptor.php +++ b/Block/Adminhtml/Form/Field/SoftDescriptor.php @@ -5,7 +5,6 @@ use Magento\Backend\Block\Template\Context; use Magento\Config\Block\System\Config\Form\Field; use Magento\Framework\Data\Form\Element\AbstractElement; -use Magento\Framework\View\Helper\SecureHtmlRenderer; use Pagarme\Pagarme\Model\Account; class SoftDescriptor extends Field @@ -25,16 +24,14 @@ class SoftDescriptor extends Field * @param Account $account * @param string $paymentMethodName * @param array $data - * @param SecureHtmlRenderer|null $secureRenderer */ public function __construct( Context $context, Account $account, string $paymentMethodName = '', - array $data = [], - ?SecureHtmlRenderer $secureRenderer = null + array $data = [] ) { - parent::__construct($context, $data, $secureRenderer); + parent::__construct($context, $data); $this->account = $account; $this->paymentMethodName = $paymentMethodName; } diff --git a/Block/Adminhtml/Form/Fieldset/CreditCardGatewayFieldset.php b/Block/Adminhtml/Form/Fieldset/CreditCardGatewayFieldset.php index 01395772..441499b5 100644 --- a/Block/Adminhtml/Form/Fieldset/CreditCardGatewayFieldset.php +++ b/Block/Adminhtml/Form/Fieldset/CreditCardGatewayFieldset.php @@ -7,7 +7,6 @@ use Magento\Config\Block\System\Config\Form\Fieldset; use Magento\Framework\Data\Form\Element\AbstractElement; use Magento\Framework\View\Helper\Js; -use Magento\Framework\View\Helper\SecureHtmlRenderer; use Pagarme\Pagarme\Model\Account; use Pagarme\Pagarme\Model\PagarmeConfigProvider; @@ -24,17 +23,15 @@ class CreditCardGatewayFieldset extends Fieldset * @param Js $jsHelper * @param Account $account * @param array $data - * @param SecureHtmlRenderer|null $secureRenderer */ public function __construct( Context $context, Session $authSession, Js $jsHelper, Account $account, - array $data = [], - ?SecureHtmlRenderer $secureRenderer = null + array $data = [] ) { - parent::__construct($context, $authSession, $jsHelper, $data, $secureRenderer); + parent::__construct($context, $authSession, $jsHelper, $data); $this->account = $account; } diff --git a/Block/Adminhtml/Form/Fieldset/CustomPaymentFieldset.php b/Block/Adminhtml/Form/Fieldset/CustomPaymentFieldset.php index c0453484..43e64d75 100644 --- a/Block/Adminhtml/Form/Fieldset/CustomPaymentFieldset.php +++ b/Block/Adminhtml/Form/Fieldset/CustomPaymentFieldset.php @@ -7,7 +7,6 @@ use Magento\Config\Block\System\Config\Form\Fieldset; use Magento\Framework\Data\Form\Element\AbstractElement; use Magento\Framework\View\Helper\Js; -use Magento\Framework\View\Helper\SecureHtmlRenderer; use Pagarme\Pagarme\Model\Account; class CustomPaymentFieldset extends Fieldset @@ -29,7 +28,6 @@ class CustomPaymentFieldset extends Fieldset * @param Account $account * @param string $paymentMethodName * @param array $data - * @param SecureHtmlRenderer|null $secureRenderer */ public function __construct( Context $context, @@ -37,10 +35,9 @@ public function __construct( Js $jsHelper, Account $account, string $paymentMethodName = '', - array $data = [], - ?SecureHtmlRenderer $secureRenderer = null + array $data = [] ) { - parent::__construct($context, $authSession, $jsHelper, $data, $secureRenderer); + parent::__construct($context, $authSession, $jsHelper, $data); $this->account = $account; $this->paymentMethodName = $paymentMethodName; } diff --git a/Block/Adminhtml/System/Config/Form/Field/HubIntegration.php b/Block/Adminhtml/System/Config/Form/Field/HubIntegration.php index a2e0e9fc..c7fa226a 100644 --- a/Block/Adminhtml/System/Config/Form/Field/HubIntegration.php +++ b/Block/Adminhtml/System/Config/Form/Field/HubIntegration.php @@ -7,7 +7,6 @@ use Magento\Config\Block\System\Config\Form\Field; use Magento\Framework\Data\Form\Element\AbstractElement; use Magento\Framework\Phrase; -use Magento\Framework\View\Helper\SecureHtmlRenderer; use Pagarme\Core\Hub\Services\HubIntegrationService; use Pagarme\Pagarme\Concrete\Magento2CoreSetup; use Pagarme\Pagarme\Model\Account; @@ -22,11 +21,10 @@ class HubIntegration extends Field public function __construct( Account $account, Context $context, - array $data = [], - ?SecureHtmlRenderer $secureRenderer = null + array $data = [] ) { $this->account = $account; - parent::__construct($context, $data, $secureRenderer); + parent::__construct($context, $data); } /** diff --git a/Model/Graphql/PixDataProvider.php b/Model/Graphql/PixDataProvider.php index b02926fe..55d87a0f 100644 --- a/Model/Graphql/PixDataProvider.php +++ b/Model/Graphql/PixDataProvider.php @@ -3,6 +3,13 @@ namespace Pagarme\Pagarme\Model\Graphql; +if (!class_exists('\Magento\QuoteGraphQl\Model\Cart\Payment\AdditionalDataProviderInterface')) { + class PixDataProvider { + + } + return; +} + use Magento\QuoteGraphQl\Model\Cart\Payment\AdditionalDataProviderInterface; /**