From ab238b25a484aa6c9cf40927478114db8d3332bb Mon Sep 17 00:00:00 2001 From: Mario Lorenz Date: Tue, 17 Sep 2024 13:18:04 +0200 Subject: [PATCH] returntypes must be compatible with CORE --- CHANGELOG.md | 5 +++++ metadata.php | 2 +- src/Controller/Admin/ConfigController.php | 13 +++++------- src/Controller/Admin/DeliverySetMain.php | 7 +++++++ src/Controller/Admin/OrderArticle.php | 24 ++++++++++++++++++----- src/Controller/Admin/OrderList.php | 3 +++ src/Controller/Admin/OrderOverview.php | 9 ++------- 7 files changed, 42 insertions(+), 21 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f191f3eb..5ed77a5e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## [2.1.7] - 2024-??-?? + +- [0007715](https://bugs.oxid-esales.com/view.php?id=7715): Fix wrong HTML-Code-Output +- [0007718](https://bugs.oxid-esales.com/view.php?id=7718): Fix compatibility-Issue with Core (Method-Return-Values must be compatible with CORE) + ## [2.1.6] - 2024-08-15 - [0007654](https://bugs.oxid-esales.com/view.php?id=7654): Fix Capture type is incorrectly evaluated diff --git a/metadata.php b/metadata.php index 2f91f884..c2ef12bf 100644 --- a/metadata.php +++ b/metadata.php @@ -60,7 +60,7 @@ 'en' => 'Use of the online payment service from amazon.com' ], 'thumbnail' => 'out/img/amazon-pay-logo.png', - 'version' => '2.1.6', + 'version' => '2.1.7-rc.1', 'author' => 'OXID eSales AG', 'url' => 'https://www.oxid-esales.com', 'email' => 'info@oxid-esales.com', diff --git a/src/Controller/Admin/ConfigController.php b/src/Controller/Admin/ConfigController.php index fd89155b..776031ea 100644 --- a/src/Controller/Admin/ConfigController.php +++ b/src/Controller/Admin/ConfigController.php @@ -24,15 +24,13 @@ */ class ConfigController extends AdminController { - public function __construct() - { - parent::__construct(); - - $this->_sThisTemplate = 'amazonpay/amazonconfig.tpl'; - } + protected $_sThisTemplate = 'amazonpay/amazonconfig.tpl'; /** + * @inheritDoc + * * @return string + * */ public function render() { @@ -134,13 +132,12 @@ protected function saveConfig(array $conf, int $shopId) * Handles checkboxes/dropdowns * * @param array $conf - * * @return array */ protected function handleSpecialFields(array $conf): array { $config = new Config(); - $conf['blAmazonPaySandboxMode'] = $conf['blAmazonPaySandboxMode'] === 'sandbox' ? true : false; + $conf['blAmazonPaySandboxMode'] = $conf['blAmazonPaySandboxMode'] === 'sandbox'; // remove FakePrivateKeys before save if ($conf['sAmazonPayPrivKey'] === '' || $conf['sAmazonPayPrivKey'] === $config->getFakePrivateKey()) { diff --git a/src/Controller/Admin/DeliverySetMain.php b/src/Controller/Admin/DeliverySetMain.php index 93b5210c..44892e3b 100644 --- a/src/Controller/Admin/DeliverySetMain.php +++ b/src/Controller/Admin/DeliverySetMain.php @@ -17,6 +17,13 @@ */ class DeliverySetMain extends DeliverySetMain_parent { + + /** + * @inheritDoc + * + * @return string + * + */ public function render() { $amazonCarriers = AmazonCarrier::getAllCarriers(); diff --git a/src/Controller/Admin/OrderArticle.php b/src/Controller/Admin/OrderArticle.php index 3b5cb0ed..7a7d288c 100644 --- a/src/Controller/Admin/OrderArticle.php +++ b/src/Controller/Admin/OrderArticle.php @@ -18,13 +18,29 @@ class OrderArticle extends OrderArticle_parent { - public function deleteThisArticle(): void + /** + * @inheritDoc + * + * @return void + * + * @throws DatabaseConnectionException + * @throws DatabaseErrorException + */ + public function deleteThisArticle() { $this->refundAmazon(); parent::deleteThisArticle(); } - public function storno(): void + /** + * @inheritDoc + * + * @return void + * + * @throws DatabaseConnectionException + * @throws DatabaseErrorException + */ + public function storno() { $this->refundAmazon(); parent::storno(); @@ -33,10 +49,8 @@ public function storno(): void /** * @throws DatabaseErrorException * @throws DatabaseConnectionException - * - * @return void */ - private function refundAmazon() + private function refundAmazon(): void { $config = new Config(); if (!$config->automatedRefundActivated()) { diff --git a/src/Controller/Admin/OrderList.php b/src/Controller/Admin/OrderList.php index 5ae2dea8..0400a152 100644 --- a/src/Controller/Admin/OrderList.php +++ b/src/Controller/Admin/OrderList.php @@ -21,7 +21,10 @@ class OrderList extends OrderList_parent { /** + * @inheritDoc + * * @return void + * * @throws DatabaseConnectionException * @throws DatabaseErrorException */ diff --git a/src/Controller/Admin/OrderOverview.php b/src/Controller/Admin/OrderOverview.php index 74cc9f6c..c4f3d76c 100644 --- a/src/Controller/Admin/OrderOverview.php +++ b/src/Controller/Admin/OrderOverview.php @@ -26,6 +26,8 @@ class OrderOverview extends OrderOverview_parent /** * @inheritDoc * + * @return string + * * @throws DatabaseErrorException * @throws DatabaseConnectionException */ @@ -125,7 +127,6 @@ public function render() } /** - * @return string * @throws DatabaseConnectionException * @throws DatabaseErrorException */ @@ -155,9 +156,6 @@ public function getAmazonAPIOrderStatus(): string return $this->captureStatus; } - /** - * @return string - */ public function getAmazonMaximalRefundAmount(): string { return PhpHelper::getMoneyValue( @@ -165,9 +163,6 @@ public function getAmazonMaximalRefundAmount(): string ); } - /** - * @return string - */ public function getAmazonMaximalCaptureAmount(): string { $order = new Order();