From 93c3b6eb29fcd4c768997e17e1eddf7f88398d84 Mon Sep 17 00:00:00 2001 From: Justin Beaty Date: Thu, 8 Feb 2018 17:39:52 -0800 Subject: [PATCH 1/2] added parameters to getAllOptions method in classes that extend Mage_Eav_Model_Entity_Attribute_Source_Table to fix PHP 7.2 strictly enforced method signatures --- .../Mage/Customer/Model/Customer/Attribute/Source/Group.php | 2 +- .../Mage/Customer/Model/Customer/Attribute/Source/Store.php | 2 +- .../Mage/Customer/Model/Customer/Attribute/Source/Website.php | 2 +- .../Customer/Model/Entity/Address/Attribute/Source/Country.php | 2 +- .../Model/Resource/Address/Attribute/Source/Country.php | 2 +- .../Customer/Model/Resource/Address/Attribute/Source/Region.php | 2 +- app/code/core/Mage/Eav/Model/Entity/Attribute/Source/Store.php | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/code/core/Mage/Customer/Model/Customer/Attribute/Source/Group.php b/app/code/core/Mage/Customer/Model/Customer/Attribute/Source/Group.php index 2241bd2fdd1..9499d326700 100644 --- a/app/code/core/Mage/Customer/Model/Customer/Attribute/Source/Group.php +++ b/app/code/core/Mage/Customer/Model/Customer/Attribute/Source/Group.php @@ -33,7 +33,7 @@ */ class Mage_Customer_Model_Customer_Attribute_Source_Group extends Mage_Eav_Model_Entity_Attribute_Source_Table { - public function getAllOptions() + public function getAllOptions($withEmpty = true, $defaultValues = false) { if (!$this->_options) { $this->_options = Mage::getResourceModel('customer/group_collection') diff --git a/app/code/core/Mage/Customer/Model/Customer/Attribute/Source/Store.php b/app/code/core/Mage/Customer/Model/Customer/Attribute/Source/Store.php index 89c3e427073..4c158d51146 100644 --- a/app/code/core/Mage/Customer/Model/Customer/Attribute/Source/Store.php +++ b/app/code/core/Mage/Customer/Model/Customer/Attribute/Source/Store.php @@ -33,7 +33,7 @@ */ class Mage_Customer_Model_Customer_Attribute_Source_Store extends Mage_Eav_Model_Entity_Attribute_Source_Table { - public function getAllOptions() + public function getAllOptions($withEmpty = true, $defaultValues = false) { if (!$this->_options) { $collection = Mage::getResourceModel('core/store_collection'); diff --git a/app/code/core/Mage/Customer/Model/Customer/Attribute/Source/Website.php b/app/code/core/Mage/Customer/Model/Customer/Attribute/Source/Website.php index 7006e8d17a1..f01118b033a 100644 --- a/app/code/core/Mage/Customer/Model/Customer/Attribute/Source/Website.php +++ b/app/code/core/Mage/Customer/Model/Customer/Attribute/Source/Website.php @@ -33,7 +33,7 @@ */ class Mage_Customer_Model_Customer_Attribute_Source_Website extends Mage_Eav_Model_Entity_Attribute_Source_Table { - public function getAllOptions() + public function getAllOptions($withEmpty = true, $defaultValues = false) { if (!$this->_options) { $this->_options = Mage::getSingleton('adminhtml/system_store')->getWebsiteValuesForForm(true, true); diff --git a/app/code/core/Mage/Customer/Model/Entity/Address/Attribute/Source/Country.php b/app/code/core/Mage/Customer/Model/Entity/Address/Attribute/Source/Country.php index 011119c8a80..6378c0d0622 100644 --- a/app/code/core/Mage/Customer/Model/Entity/Address/Attribute/Source/Country.php +++ b/app/code/core/Mage/Customer/Model/Entity/Address/Attribute/Source/Country.php @@ -56,7 +56,7 @@ public function __construct(array $args = array()) * * @return array */ - public function getAllOptions() + public function getAllOptions($withEmpty = true, $defaultValues = false) { if (!$this->_options) { $this->_options = $this->_factory->getResourceModel('directory/country_collection') diff --git a/app/code/core/Mage/Customer/Model/Resource/Address/Attribute/Source/Country.php b/app/code/core/Mage/Customer/Model/Resource/Address/Attribute/Source/Country.php index 923d428a09f..6250ebccb57 100644 --- a/app/code/core/Mage/Customer/Model/Resource/Address/Attribute/Source/Country.php +++ b/app/code/core/Mage/Customer/Model/Resource/Address/Attribute/Source/Country.php @@ -39,7 +39,7 @@ class Mage_Customer_Model_Resource_Address_Attribute_Source_Country extends Mage * * @return array */ - public function getAllOptions() + public function getAllOptions($withEmpty = true, $defaultValues = false) { if (!$this->_options) { $this->_options = Mage::getResourceModel('directory/country_collection') diff --git a/app/code/core/Mage/Customer/Model/Resource/Address/Attribute/Source/Region.php b/app/code/core/Mage/Customer/Model/Resource/Address/Attribute/Source/Region.php index de4efd13c35..a97b4169e41 100644 --- a/app/code/core/Mage/Customer/Model/Resource/Address/Attribute/Source/Region.php +++ b/app/code/core/Mage/Customer/Model/Resource/Address/Attribute/Source/Region.php @@ -39,7 +39,7 @@ class Mage_Customer_Model_Resource_Address_Attribute_Source_Region extends Mage_ * * @return array */ - public function getAllOptions() + public function getAllOptions($withEmpty = true, $defaultValues = false) { if (!$this->_options) { $this->_options = Mage::getResourceModel('directory/region_collection')->load()->toOptionArray(); diff --git a/app/code/core/Mage/Eav/Model/Entity/Attribute/Source/Store.php b/app/code/core/Mage/Eav/Model/Entity/Attribute/Source/Store.php index 5be666c65a6..4c6d831546b 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Attribute/Source/Store.php +++ b/app/code/core/Mage/Eav/Model/Entity/Attribute/Source/Store.php @@ -38,7 +38,7 @@ class Mage_Eav_Model_Entity_Attribute_Source_Store extends Mage_Eav_Model_Entity * * @return array */ - public function getAllOptions() + public function getAllOptions($withEmpty = true, $defaultValues = false) { if ($this->_options === null) { $this->_options = Mage::getResourceModel('core/store_collection')->load()->toOptionArray(); From da2afdb82bb427da7561ac9bea5bc4541e4dc42e Mon Sep 17 00:00:00 2001 From: Justin Beaty Date: Mon, 12 Feb 2018 12:52:10 -0800 Subject: [PATCH 2/2] added phpdoc params to getAllOptions methods indicating arguments have no effect --- .../Customer/Model/Customer/Attribute/Source/Group.php | 7 +++++++ .../Customer/Model/Customer/Attribute/Source/Store.php | 7 +++++++ .../Customer/Model/Customer/Attribute/Source/Website.php | 7 +++++++ .../Model/Entity/Address/Attribute/Source/Country.php | 2 ++ .../Model/Resource/Address/Attribute/Source/Country.php | 2 ++ .../Model/Resource/Address/Attribute/Source/Region.php | 2 ++ .../core/Mage/Eav/Model/Entity/Attribute/Source/Store.php | 2 ++ 7 files changed, 29 insertions(+) diff --git a/app/code/core/Mage/Customer/Model/Customer/Attribute/Source/Group.php b/app/code/core/Mage/Customer/Model/Customer/Attribute/Source/Group.php index 9499d326700..d0802e34af7 100644 --- a/app/code/core/Mage/Customer/Model/Customer/Attribute/Source/Group.php +++ b/app/code/core/Mage/Customer/Model/Customer/Attribute/Source/Group.php @@ -33,6 +33,13 @@ */ class Mage_Customer_Model_Customer_Attribute_Source_Group extends Mage_Eav_Model_Entity_Attribute_Source_Table { + /** + * Retrieve Full Option values array + * + * @param bool $withEmpty Argument has no effect, included for PHP 7.2 method signature compatibility + * @param bool $defaultValues Argument has no effect, included for PHP 7.2 method signature compatibility + * @return array + */ public function getAllOptions($withEmpty = true, $defaultValues = false) { if (!$this->_options) { diff --git a/app/code/core/Mage/Customer/Model/Customer/Attribute/Source/Store.php b/app/code/core/Mage/Customer/Model/Customer/Attribute/Source/Store.php index 4c158d51146..92d41fcad1c 100644 --- a/app/code/core/Mage/Customer/Model/Customer/Attribute/Source/Store.php +++ b/app/code/core/Mage/Customer/Model/Customer/Attribute/Source/Store.php @@ -33,6 +33,13 @@ */ class Mage_Customer_Model_Customer_Attribute_Source_Store extends Mage_Eav_Model_Entity_Attribute_Source_Table { + /** + * Retrieve Full Option values array + * + * @param bool $withEmpty Argument has no effect, included for PHP 7.2 method signature compatibility + * @param bool $defaultValues Argument has no effect, included for PHP 7.2 method signature compatibility + * @return array + */ public function getAllOptions($withEmpty = true, $defaultValues = false) { if (!$this->_options) { diff --git a/app/code/core/Mage/Customer/Model/Customer/Attribute/Source/Website.php b/app/code/core/Mage/Customer/Model/Customer/Attribute/Source/Website.php index f01118b033a..136bc5226fa 100644 --- a/app/code/core/Mage/Customer/Model/Customer/Attribute/Source/Website.php +++ b/app/code/core/Mage/Customer/Model/Customer/Attribute/Source/Website.php @@ -33,6 +33,13 @@ */ class Mage_Customer_Model_Customer_Attribute_Source_Website extends Mage_Eav_Model_Entity_Attribute_Source_Table { + /** + * Retrieve Full Option values array + * + * @param bool $withEmpty Argument has no effect, included for PHP 7.2 method signature compatibility + * @param bool $defaultValues Argument has no effect, included for PHP 7.2 method signature compatibility + * @return array + */ public function getAllOptions($withEmpty = true, $defaultValues = false) { if (!$this->_options) { diff --git a/app/code/core/Mage/Customer/Model/Entity/Address/Attribute/Source/Country.php b/app/code/core/Mage/Customer/Model/Entity/Address/Attribute/Source/Country.php index 6378c0d0622..6df98e7236c 100644 --- a/app/code/core/Mage/Customer/Model/Entity/Address/Attribute/Source/Country.php +++ b/app/code/core/Mage/Customer/Model/Entity/Address/Attribute/Source/Country.php @@ -54,6 +54,8 @@ public function __construct(array $args = array()) /** * Retrieve all options * + * @param bool $withEmpty Argument has no effect, included for PHP 7.2 method signature compatibility + * @param bool $defaultValues Argument has no effect, included for PHP 7.2 method signature compatibility * @return array */ public function getAllOptions($withEmpty = true, $defaultValues = false) diff --git a/app/code/core/Mage/Customer/Model/Resource/Address/Attribute/Source/Country.php b/app/code/core/Mage/Customer/Model/Resource/Address/Attribute/Source/Country.php index 6250ebccb57..b36a8d1eee3 100644 --- a/app/code/core/Mage/Customer/Model/Resource/Address/Attribute/Source/Country.php +++ b/app/code/core/Mage/Customer/Model/Resource/Address/Attribute/Source/Country.php @@ -37,6 +37,8 @@ class Mage_Customer_Model_Resource_Address_Attribute_Source_Country extends Mage /** * Retreive all options * + * @param bool $withEmpty Argument has no effect, included for PHP 7.2 method signature compatibility + * @param bool $defaultValues Argument has no effect, included for PHP 7.2 method signature compatibility * @return array */ public function getAllOptions($withEmpty = true, $defaultValues = false) diff --git a/app/code/core/Mage/Customer/Model/Resource/Address/Attribute/Source/Region.php b/app/code/core/Mage/Customer/Model/Resource/Address/Attribute/Source/Region.php index a97b4169e41..de5c1f032d0 100644 --- a/app/code/core/Mage/Customer/Model/Resource/Address/Attribute/Source/Region.php +++ b/app/code/core/Mage/Customer/Model/Resource/Address/Attribute/Source/Region.php @@ -37,6 +37,8 @@ class Mage_Customer_Model_Resource_Address_Attribute_Source_Region extends Mage_ /** * Retreive all region options * + * @param bool $withEmpty Argument has no effect, included for PHP 7.2 method signature compatibility + * @param bool $defaultValues Argument has no effect, included for PHP 7.2 method signature compatibility * @return array */ public function getAllOptions($withEmpty = true, $defaultValues = false) diff --git a/app/code/core/Mage/Eav/Model/Entity/Attribute/Source/Store.php b/app/code/core/Mage/Eav/Model/Entity/Attribute/Source/Store.php index 4c6d831546b..ecf39074ec5 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Attribute/Source/Store.php +++ b/app/code/core/Mage/Eav/Model/Entity/Attribute/Source/Store.php @@ -36,6 +36,8 @@ class Mage_Eav_Model_Entity_Attribute_Source_Store extends Mage_Eav_Model_Entity /** * Retrieve Full Option values array * + * @param bool $withEmpty Argument has no effect, included for PHP 7.2 method signature compatibility + * @param bool $defaultValues Argument has no effect, included for PHP 7.2 method signature compatibility * @return array */ public function getAllOptions($withEmpty = true, $defaultValues = false)