From 05ef9c5f3ed1c8e7e48cd524dc275cc8345d1684 Mon Sep 17 00:00:00 2001 From: Serhii Koval Date: Tue, 19 Aug 2025 12:59:18 +0200 Subject: [PATCH 1/2] Replace deprecated \Magento\Framewfork\Option\ArrayInterface with \Magento\Framewfork\Option\OptionSourceInterface --- Model/System/Config/Source/ApiMode.php | 7 +++++-- Model/System/Config/Source/ApiVersion.php | 9 +++++---- Model/System/Config/Source/ApiVersionRbc.php | 9 +++++---- .../System/Config/Source/TargetedFinancing.php | 17 ++++++++++++++--- Model/System/Config/Source/Tenant.php | 15 +++++++++------ Model/System/Config/Source/TenantRbc.php | 15 +++++++++------ 6 files changed, 47 insertions(+), 25 deletions(-) diff --git a/Model/System/Config/Source/ApiMode.php b/Model/System/Config/Source/ApiMode.php index 6ca65e2d..0096a41c 100644 --- a/Model/System/Config/Source/ApiMode.php +++ b/Model/System/Config/Source/ApiMode.php @@ -6,11 +6,14 @@ * @author Joel @Mediotype * @author Miranda @Mediotype */ +declare(strict_types=1); + namespace Bread\BreadCheckout\Model\System\Config\Source; -class ApiMode implements \Magento\Framework\Option\ArrayInterface -{ +use Magento\Framework\Data\OptionSourceInterface; +class ApiMode implements OptionSourceInterface +{ /** * Options getter * diff --git a/Model/System/Config/Source/ApiVersion.php b/Model/System/Config/Source/ApiVersion.php index 36cb4cba..2f8f87b2 100644 --- a/Model/System/Config/Source/ApiVersion.php +++ b/Model/System/Config/Source/ApiVersion.php @@ -1,5 +1,4 @@ */ +declare(strict_types=1); namespace Bread\BreadCheckout\Model\System\Config\Source; -class ApiVersion implements \Magento\Framework\Option\ArrayInterface { +use Magento\Framework\Data\OptionSourceInterface; +class ApiVersion implements OptionSourceInterface +{ /** * Options getter * @@ -35,5 +37,4 @@ public function toArray() { 'bread_2' => __('Bread Platform') ]; } - -} \ No newline at end of file +} diff --git a/Model/System/Config/Source/ApiVersionRbc.php b/Model/System/Config/Source/ApiVersionRbc.php index 1fd4def9..0fbc056d 100644 --- a/Model/System/Config/Source/ApiVersionRbc.php +++ b/Model/System/Config/Source/ApiVersionRbc.php @@ -1,5 +1,4 @@ */ +declare(strict_types=1); namespace Bread\BreadCheckout\Model\System\Config\Source; -class ApiVersionRbc implements \Magento\Framework\Option\ArrayInterface { +use Magento\Framework\Data\OptionSourceInterface; +class ApiVersionRbc implements OptionSourceInterface +{ /** * Options getter * @@ -33,5 +35,4 @@ public function toArray() { 'bread_2' => __('Bread 2.0') ]; } - -} \ No newline at end of file +} diff --git a/Model/System/Config/Source/TargetedFinancing.php b/Model/System/Config/Source/TargetedFinancing.php index 241444e8..3e321bfc 100644 --- a/Model/System/Config/Source/TargetedFinancing.php +++ b/Model/System/Config/Source/TargetedFinancing.php @@ -1,8 +1,11 @@ 0, 'label' => __('No')], ['value' => 1, 'label' => __('By Cart Size')], ['value' => 2, 'label' => __('By SKU List')]]; + return [ + ['value' => 0, 'label' => __('No')], + ['value' => 1, 'label' => __('By Cart Size')], + ['value' => 2, 'label' => __('By SKU List')] + ]; } /** @@ -21,6 +28,10 @@ public function toOptionArray() */ public function toArray() { - return [0 => __('No'), 1 => __('By Cart Size'), 2 => __('By SKU List')]; + return [ + 0 => __('No'), + 1 => __('By Cart Size'), + 2 => __('By SKU List') + ]; } } diff --git a/Model/System/Config/Source/Tenant.php b/Model/System/Config/Source/Tenant.php index 756f4f7e..e06cb425 100644 --- a/Model/System/Config/Source/Tenant.php +++ b/Model/System/Config/Source/Tenant.php @@ -1,5 +1,4 @@ */ +declare(strict_types=1); namespace Bread\BreadCheckout\Model\System\Config\Source; -class Tenant implements \Magento\Framework\Option\ArrayInterface { +use Magento\Framework\Data\OptionSourceInterface; +class Tenant implements OptionSourceInterface +{ /** * Options getter * * @return array */ - public function toOptionArray() { + public function toOptionArray() + { return [ ['value' => 'core', 'label' => __('CORE (US)')], ]; @@ -28,10 +31,10 @@ public function toOptionArray() { * * @return array */ - public function toArray() { + public function toArray() + { return [ 'core' => __('CORE (US'), ]; } - -} \ No newline at end of file +} diff --git a/Model/System/Config/Source/TenantRbc.php b/Model/System/Config/Source/TenantRbc.php index 5f648b53..492872d5 100644 --- a/Model/System/Config/Source/TenantRbc.php +++ b/Model/System/Config/Source/TenantRbc.php @@ -1,5 +1,4 @@ */ +declare(strict_types=1); namespace Bread\BreadCheckout\Model\System\Config\Source; -class TenantRbc implements \Magento\Framework\Option\ArrayInterface { +use Magento\Framework\Data\OptionSourceInterface; +class TenantRbc implements OptionSourceInterface +{ /** * Options getter * * @return array */ - public function toOptionArray() { + public function toOptionArray() + { return [ ['value' => 'rbc', 'label' => __('Payplan by RBC')], ]; @@ -28,10 +31,10 @@ public function toOptionArray() { * * @return array */ - public function toArray() { + public function toArray() + { return [ 'rbc' => __('Payplan by RBC'), ]; } - -} \ No newline at end of file +} From 7388b168575c8c4b701af601ec6b90be7942066e Mon Sep 17 00:00:00 2001 From: Serhii Koval Date: Tue, 19 Aug 2025 13:26:54 +0200 Subject: [PATCH 2/2] Update Model/System/Config/Source/Tenant.php Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- Model/System/Config/Source/Tenant.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Model/System/Config/Source/Tenant.php b/Model/System/Config/Source/Tenant.php index e06cb425..53e52a4b 100644 --- a/Model/System/Config/Source/Tenant.php +++ b/Model/System/Config/Source/Tenant.php @@ -34,7 +34,7 @@ public function toOptionArray() public function toArray() { return [ - 'core' => __('CORE (US'), + 'core' => __('CORE (US)'), ]; } }