From e9dc0153d43eaa37f92a2484d454575d8467fd28 Mon Sep 17 00:00:00 2001 From: Mikolaj Popielarz Date: Fri, 19 May 2023 10:52:23 +0200 Subject: [PATCH] Feature/php8.2 deprecation (#19) * fix php8.2 depreciation * bump version * cs fixes --------- Co-authored-by: Mikolaj Popielarz --- Api/Kevin.php | 26 ------------------- .../Field/Accounts/BankColumnViewBuilder.php | 2 -- .../Accounts/CountryColumnViewBuilder.php | 2 -- .../System/Config/PaymentListButton.php | 4 +-- Gateway/Config/Config.php | 7 +++-- Helper/Data.php | 8 ------ Logger/Handler.php | 3 --- Model/Adapter.php | 9 ------- Model/Creditmemo/Delete.php | 12 +-------- Plugin/Sales/Order.php | 4 +-- .../Order/Email/Sender/InvoiceSender.php | 2 -- Plugin/Sales/Order/Handler/State.php | 2 -- composer.json | 2 +- etc/module.xml | 2 +- 14 files changed, 11 insertions(+), 74 deletions(-) diff --git a/Api/Kevin.php b/Api/Kevin.php index cc7b08f..0b50bef 100644 --- a/Api/Kevin.php +++ b/Api/Kevin.php @@ -20,9 +20,6 @@ class Kevin */ protected $config; - /** - * @var - */ protected $banks; /** @@ -42,9 +39,6 @@ public function __construct( } /** - * @param $clientId - * @param $clientSecret - * * @return Client|void */ public function getConnection($clientId = null, $clientSecret = null) @@ -150,8 +144,6 @@ public function getBanks($country = null) } /** - * @param $bankId - * * @return array */ public function getBank($bankId) @@ -167,8 +159,6 @@ public function getBank($bankId) } /** - * @param $params - * * @return mixed */ public function initPayment($params) @@ -177,9 +167,6 @@ public function initPayment($params) } /** - * @param $paymentId - * @param $attr - * * @return mixed */ public function getPaymentStatus($paymentId, $attr) @@ -188,9 +175,6 @@ public function getPaymentStatus($paymentId, $attr) } /** - * @param $paymentId - * @param $attr - * * @return mixed */ public function getPayment($paymentId, $attr) @@ -216,9 +200,6 @@ public function getAvailableCountries() } /** - * @param $paymentId - * @param $attr - * * @return mixed */ public function initRefund($paymentId, $attr) @@ -227,8 +208,6 @@ public function initRefund($paymentId, $attr) } /** - * @param $paymentId - * * @return mixed|void */ public function getRefunds($paymentId) @@ -240,11 +219,6 @@ public function getRefunds($paymentId) } /** - * @param $endpointSecret - * @param $requestBody - * @param $headers - * @param $webhookUrl - * * @return mixed */ public function verifySignature($endpointSecret, $requestBody, $headers, $webhookUrl) diff --git a/Block/Adminhtml/Form/Field/Accounts/BankColumnViewBuilder.php b/Block/Adminhtml/Form/Field/Accounts/BankColumnViewBuilder.php index bad0125..73e5d14 100644 --- a/Block/Adminhtml/Form/Field/Accounts/BankColumnViewBuilder.php +++ b/Block/Adminhtml/Form/Field/Accounts/BankColumnViewBuilder.php @@ -36,8 +36,6 @@ public function setInputName($value) /** * Set "id" for element. * - * @param $value - * * @return $this */ public function setInputId($value) diff --git a/Block/Adminhtml/System/Config/PaymentListButton.php b/Block/Adminhtml/System/Config/PaymentListButton.php index 7be7876..38fa0f9 100644 --- a/Block/Adminhtml/System/Config/PaymentListButton.php +++ b/Block/Adminhtml/System/Config/PaymentListButton.php @@ -68,9 +68,9 @@ public function getAjaxUrl() } /** - * @throws LocalizedException - * * @return string + * + * @throws LocalizedException */ public function getButtonHtml() { diff --git a/Gateway/Config/Config.php b/Gateway/Config/Config.php index bfb4ce7..30f3f97 100644 --- a/Gateway/Config/Config.php +++ b/Gateway/Config/Config.php @@ -35,6 +35,11 @@ class Config extends \Magento\Payment\Gateway\Config\Config */ protected $serialize; + /** + * @var string|null + */ + private $methodCode; + /** * @param string|null $methodCode * @param string $pathPattern @@ -204,8 +209,6 @@ public function setStatus($status) } /** - * @param $countryList - * * @return void */ public function setCountryList($countryList) diff --git a/Helper/Data.php b/Helper/Data.php index 313b0de..8618951 100644 --- a/Helper/Data.php +++ b/Helper/Data.php @@ -53,8 +53,6 @@ public function __construct( } /** - * @param $quoteId - * * @return void * * @throws \Magento\Framework\Exception\NoSuchEntityException @@ -70,8 +68,6 @@ public function setQuoteInactive($quoteId) } /** - * @param $tableName - * * @return void */ public function truncateTable($tableName) @@ -86,8 +82,6 @@ public function truncateTable($tableName) } /** - * @param $bankList - * * @return bool */ public function saveAvailablePaymentList($bankList) @@ -112,8 +106,6 @@ public function saveAvailablePaymentList($bankList) } /** - * @param $countryList - * * @return void */ public function saveAvailableCountryList($countryList) diff --git a/Logger/Handler.php b/Logger/Handler.php index 14de6bd..d13b30d 100644 --- a/Logger/Handler.php +++ b/Logger/Handler.php @@ -10,9 +10,6 @@ */ class Handler extends Base { - /** - * @var - */ protected $loggerType = Logger::INFO; /** diff --git a/Model/Adapter.php b/Model/Adapter.php index 8bba528..d7cf654 100644 --- a/Model/Adapter.php +++ b/Model/Adapter.php @@ -68,8 +68,6 @@ public function __construct( } /** - * @param $order - * * @return array */ public function initPayment($order) @@ -135,7 +133,6 @@ public function initPayment($order) /** * @param $payment - * @param $amount * * @return array */ @@ -196,8 +193,6 @@ public function createTransaction($order = null, $paymentData = []) } /** - * @param $transactionId - * * @return mixed */ public function getTransaction($transactionId) @@ -210,8 +205,6 @@ public function getTransaction($transactionId) } /** - * @param $uri - * * @return string */ private function getWebHookContextUrl($uri) @@ -224,8 +217,6 @@ private function getWebHookContextUrl($uri) } /** - * @param $uri - * * @return string */ private function getRedirectContextUrl($uri) diff --git a/Model/Creditmemo/Delete.php b/Model/Creditmemo/Delete.php index f8e7f69..fdb7205 100644 --- a/Model/Creditmemo/Delete.php +++ b/Model/Creditmemo/Delete.php @@ -2,7 +2,6 @@ namespace Kevin\Payment\Model\Creditmemo; -use Exception; use Magento\Backend\Model\Auth\Session; use Magento\Framework\Registry; use Magento\Sales\Api\CreditmemoRepositoryInterface; @@ -59,8 +58,6 @@ public function __construct( } /** - * @param $creditmemoId - * * @return \Magento\Sales\Model\Order * * @throws \Exception @@ -152,7 +149,7 @@ public function deleteCreditmemo($creditmemoId) // delete credit-memo by credit-memo object $this->creditmemoRepository->delete($creditmemoData); $this->orderRepository->save($order); - } catch (Exception $exception) { + } catch (\Exception $exception) { echo $exception->getMessage(); exit; $this->logger->critical($exception->getMessage()); @@ -161,10 +158,6 @@ public function deleteCreditmemo($creditmemoId) return $order; } - /** - * @param $creditmemo - * @param $order - */ protected function setTotalandBaseTotal($creditmemo, $order) { if ($creditmemo->getDoTransaction()) { @@ -178,9 +171,6 @@ protected function setTotalandBaseTotal($creditmemo, $order) } } - /** - * @param $order - */ protected function saveOrder($order) { if ($order->hasShipments() || $order->hasInvoices() || $order->hasCreditmemos()) { diff --git a/Plugin/Sales/Order.php b/Plugin/Sales/Order.php index 90187ef..3c22220 100644 --- a/Plugin/Sales/Order.php +++ b/Plugin/Sales/Order.php @@ -16,13 +16,11 @@ public function __construct( } /** - * @param $result - * * @return mixed */ public function afterGetCanSendNewEmailFlag( \Magento\Sales\Model\Order $subject, - $result + $result ) { if ($subject->getPayment()->getMethodInstance()->getCode() == \Kevin\Payment\Model\Ui\ConfigProvider::CODE && !$this->config->getSendOrderEmailBefore()) { diff --git a/Plugin/Sales/Order/Email/Sender/InvoiceSender.php b/Plugin/Sales/Order/Email/Sender/InvoiceSender.php index e079faf..18d059d 100644 --- a/Plugin/Sales/Order/Email/Sender/InvoiceSender.php +++ b/Plugin/Sales/Order/Email/Sender/InvoiceSender.php @@ -23,8 +23,6 @@ public function __construct( } /** - * @param $forceSyncMode - * * @return void */ public function aroundSend( diff --git a/Plugin/Sales/Order/Handler/State.php b/Plugin/Sales/Order/Handler/State.php index fa2ddcd..795e49c 100644 --- a/Plugin/Sales/Order/Handler/State.php +++ b/Plugin/Sales/Order/Handler/State.php @@ -16,8 +16,6 @@ public function __construct( } /** - * @param $order - * * @return mixed|void */ public function aroundCheck( diff --git a/composer.json b/composer.json index a0f9c73..006c0a7 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "getkevin/kevin-magento2", "description": "Implements integration with the Kevin payment service provider.", - "version": "1.3.3", + "version": "1.3.4", "authors": [ { "name": "kevin.", diff --git a/etc/module.xml b/etc/module.xml index 500fe46..3be4d28 100644 --- a/etc/module.xml +++ b/etc/module.xml @@ -1,6 +1,6 @@ - +