diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index 653d7c3268e..fb06ee5555f 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -63,6 +63,8 @@ 'no_trailing_whitespace_in_comment' => true, // Remove trailing whitespace at the end of blank lines. 'no_whitespace_in_blank_line' => true, + // Adds or removes ? before single type declarations or |null at the end of union types when parameters have a default null value. + 'nullable_type_declaration_for_default_null_value' => true, // Orders the elements of classes/interfaces/traits. 'ordered_class_elements' => false, // Ordering `use` statements. diff --git a/app/code/core/Mage/Admin/Model/Acl/Assert/Ip.php b/app/code/core/Mage/Admin/Model/Acl/Assert/Ip.php index cc524a2a7c5..ca25cbe4125 100644 --- a/app/code/core/Mage/Admin/Model/Acl/Assert/Ip.php +++ b/app/code/core/Mage/Admin/Model/Acl/Assert/Ip.php @@ -32,8 +32,8 @@ class Mage_Admin_Model_Acl_Assert_Ip implements Zend_Acl_Assert_Interface */ public function assert( Mage_Admin_Model_Acl $acl, - Mage_Admin_Model_Acl_Role $role = null, - Mage_Admin_Model_Acl_Resource $resource = null, + ?Mage_Admin_Model_Acl_Role $role = null, + ?Mage_Admin_Model_Acl_Resource $resource = null, $privilege = null ) { return $this->_isCleanIP(Mage::helper('core/http')->getRemoteAddr()); diff --git a/app/code/core/Mage/Admin/Model/Acl/Assert/Time.php b/app/code/core/Mage/Admin/Model/Acl/Assert/Time.php index f82ad8394e8..e69d46c8529 100644 --- a/app/code/core/Mage/Admin/Model/Acl/Assert/Time.php +++ b/app/code/core/Mage/Admin/Model/Acl/Assert/Time.php @@ -32,8 +32,8 @@ class Mage_Admin_Model_Acl_Assert_Time implements Zend_Acl_Assert_Interface */ public function assert( Mage_Admin_Model_Acl $acl, - Mage_Admin_Model_Acl_Role $role = null, - Mage_Admin_Model_Acl_Resource $resource = null, + ?Mage_Admin_Model_Acl_Role $role = null, + ?Mage_Admin_Model_Acl_Resource $resource = null, $privilege = null ) { return $this->_isCleanTime(time()); diff --git a/app/code/core/Mage/Admin/Model/Redirectpolicy.php b/app/code/core/Mage/Admin/Model/Redirectpolicy.php index 8782ca92853..85a501d22d9 100644 --- a/app/code/core/Mage/Admin/Model/Redirectpolicy.php +++ b/app/code/core/Mage/Admin/Model/Redirectpolicy.php @@ -45,7 +45,7 @@ public function __construct($parameters = []) */ public function getRedirectUrl( Mage_Admin_Model_User $user, - Zend_Controller_Request_Http $request = null, + ?Zend_Controller_Request_Http $request = null, $alternativeUrl = null ) { if (empty($request)) { diff --git a/app/code/core/Mage/Admin/Model/Roles.php b/app/code/core/Mage/Admin/Model/Roles.php index 142f9dd2a71..9ecda32e68d 100644 --- a/app/code/core/Mage/Admin/Model/Roles.php +++ b/app/code/core/Mage/Admin/Model/Roles.php @@ -123,7 +123,7 @@ public function getRoleUsers() * @return Varien_Simplexml_Element|false|array */ protected function _buildResourcesArray( - Varien_Simplexml_Element $resource = null, + ?Varien_Simplexml_Element $resource = null, $parentName = null, $level = 0, $represent2Darray = null, diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Composite/Configure.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Composite/Configure.php index 7bae1cec612..d15d4a6b5a3 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Composite/Configure.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Composite/Configure.php @@ -54,7 +54,7 @@ public function getProduct() * @param Mage_Catalog_Model_Product|null $product * @return $this */ - public function setProduct(Mage_Catalog_Model_Product $product = null) + public function setProduct(?Mage_Catalog_Model_Product $product = null) { $this->_product = $product; return $this; diff --git a/app/code/core/Mage/Adminhtml/Controller/Action.php b/app/code/core/Mage/Adminhtml/Controller/Action.php index d15e426e4ba..ec3fd52958d 100644 --- a/app/code/core/Mage/Adminhtml/Controller/Action.php +++ b/app/code/core/Mage/Adminhtml/Controller/Action.php @@ -367,7 +367,7 @@ protected function _redirect($path, $arguments = []) return $this; } - protected function _forward($action, $controller = null, $module = null, array $params = null) + protected function _forward($action, $controller = null, $module = null, ?array $params = null) { $this->_getSession()->setIsUrlNotice($this->getFlag('', self::FLAG_IS_URLS_CHECKED)); return parent::_forward($action, $controller, $module, $params); diff --git a/app/code/core/Mage/Adminhtml/Helper/Config.php b/app/code/core/Mage/Adminhtml/Helper/Config.php index 5e9c75a6bea..5e29f965338 100644 --- a/app/code/core/Mage/Adminhtml/Helper/Config.php +++ b/app/code/core/Mage/Adminhtml/Helper/Config.php @@ -31,7 +31,7 @@ class Mage_Adminhtml_Helper_Config extends Mage_Core_Helper_Abstract * @param string $inputType * @return array */ - public function getInputTypes(string $inputType = null): array + public function getInputTypes(?string $inputType = null): array { $inputTypes = [ 'color' => [ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Admin/Page.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Admin/Page.php index e7e65b40788..e79b3daedc4 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Admin/Page.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Admin/Page.php @@ -70,7 +70,7 @@ protected function _getUrlModel() return $this->_url; } - protected function _buildMenuArray(Varien_Simplexml_Element $parent = null, $path = '', $level = 0) + protected function _buildMenuArray(?Varien_Simplexml_Element $parent = null, $path = '', $level = 0) { if (is_null($parent)) { $parent = Mage::getSingleton('admin/config')->getAdminhtmlConfig()->getNode('menu'); diff --git a/app/code/core/Mage/Api/Model/Acl/Assert/Ip.php b/app/code/core/Mage/Api/Model/Acl/Assert/Ip.php index 9cd4279cba0..189c550dadc 100644 --- a/app/code/core/Mage/Api/Model/Acl/Assert/Ip.php +++ b/app/code/core/Mage/Api/Model/Acl/Assert/Ip.php @@ -32,8 +32,8 @@ class Mage_Api_Model_Acl_Assert_Ip implements Zend_Acl_Assert_Interface */ public function assert( Mage_Api_Model_Acl $acl, - Mage_Api_Model_Acl_Role $role = null, - Mage_Api_Model_Acl_Resource $resource = null, + ?Mage_Api_Model_Acl_Role $role = null, + ?Mage_Api_Model_Acl_Resource $resource = null, $privilege = null ) { return $this->_isCleanIP(Mage::helper('core/http')->getRemoteAddr()); diff --git a/app/code/core/Mage/Api/Model/Acl/Assert/Time.php b/app/code/core/Mage/Api/Model/Acl/Assert/Time.php index 31e2df3faef..903cbe17030 100644 --- a/app/code/core/Mage/Api/Model/Acl/Assert/Time.php +++ b/app/code/core/Mage/Api/Model/Acl/Assert/Time.php @@ -32,8 +32,8 @@ class Mage_Api_Model_Acl_Assert_Time implements Zend_Acl_Assert_Interface */ public function assert( Mage_Api_Model_Acl $acl, - Mage_Api_Model_Acl_Role $role = null, - Mage_Api_Model_Acl_Resource $resource = null, + ?Mage_Api_Model_Acl_Role $role = null, + ?Mage_Api_Model_Acl_Resource $resource = null, $privilege = null ) { return $this->_isCleanTime(time()); diff --git a/app/code/core/Mage/Api/Model/Roles.php b/app/code/core/Mage/Api/Model/Roles.php index bedc0e43c2a..d73dd218a3e 100644 --- a/app/code/core/Mage/Api/Model/Roles.php +++ b/app/code/core/Mage/Api/Model/Roles.php @@ -108,7 +108,7 @@ public function getRoleUsers() * @return array|false|Varien_Simplexml_Element */ protected function _buildResourcesArray( - Varien_Simplexml_Element $resource = null, + ?Varien_Simplexml_Element $resource = null, $parentName = null, $level = 0, $represent2Darray = null, diff --git a/app/code/core/Mage/Api2/Model/Route/ApiType.php b/app/code/core/Mage/Api2/Model/Route/ApiType.php index 8975ff07c59..6ffd07566bc 100644 --- a/app/code/core/Mage/Api2/Model/Route/ApiType.php +++ b/app/code/core/Mage/Api2/Model/Route/ApiType.php @@ -42,7 +42,7 @@ public function __construct( $route, $defaults = [], $reqs = [], - Zend_Translate $translator = null, + ?Zend_Translate $translator = null, $locale = null ) { parent::__construct([Mage_Api2_Model_Route_Abstract::PARAM_ROUTE => str_replace('.php', '', basename(getenv('SCRIPT_FILENAME'))) . '/:api_type']); diff --git a/app/code/core/Mage/Catalog/Block/Product/View/Options.php b/app/code/core/Mage/Catalog/Block/Product/View/Options.php index 63f8dbfd6a0..ab9cecd8499 100644 --- a/app/code/core/Mage/Catalog/Block/Product/View/Options.php +++ b/app/code/core/Mage/Catalog/Block/Product/View/Options.php @@ -61,7 +61,7 @@ public function getProduct() * @param Mage_Catalog_Model_Product|null $product * @return $this */ - public function setProduct(Mage_Catalog_Model_Product $product = null) + public function setProduct(?Mage_Catalog_Model_Product $product = null) { $this->_product = $product; return $this; diff --git a/app/code/core/Mage/Catalog/Block/Product/View/Options/Abstract.php b/app/code/core/Mage/Catalog/Block/Product/View/Options/Abstract.php index 8d52a32d6a2..559c59b6495 100644 --- a/app/code/core/Mage/Catalog/Block/Product/View/Options/Abstract.php +++ b/app/code/core/Mage/Catalog/Block/Product/View/Options/Abstract.php @@ -41,7 +41,7 @@ abstract class Mage_Catalog_Block_Product_View_Options_Abstract extends Mage_Cor * @param Mage_Catalog_Model_Product|null $product * @return $this */ - public function setProduct(Mage_Catalog_Model_Product $product = null) + public function setProduct(?Mage_Catalog_Model_Product $product = null) { $this->_product = $product; return $this; diff --git a/app/code/core/Mage/Catalog/Model/Product/Compare/Item.php b/app/code/core/Mage/Catalog/Model/Product/Compare/Item.php index 8b5c9cc802a..f7d95c4748e 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Compare/Item.php +++ b/app/code/core/Mage/Catalog/Model/Product/Compare/Item.php @@ -177,7 +177,7 @@ public function bindCustomerLogin() * @param Varien_Event_Observer|null $observer * @return $this */ - public function bindCustomerLogout(Varien_Event_Observer $observer = null) + public function bindCustomerLogout(?Varien_Event_Observer $observer = null) { $this->_getResource()->purgeVisitorByCustomer($this); diff --git a/app/code/core/Mage/Catalog/Model/Product/Option.php b/app/code/core/Mage/Catalog/Model/Product/Option.php index e58a6a07b9b..edf72c02fa6 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Option.php +++ b/app/code/core/Mage/Catalog/Model/Product/Option.php @@ -262,7 +262,7 @@ public function getProduct() * @param Mage_Catalog_Model_Product|null $product * @return $this */ - public function setProduct(Mage_Catalog_Model_Product $product = null) + public function setProduct(?Mage_Catalog_Model_Product $product = null) { $this->_product = $product; return $this; diff --git a/app/code/core/Mage/Catalog/Model/Resource/Category/Indexer/Product.php b/app/code/core/Mage/Catalog/Model/Resource/Category/Indexer/Product.php index dfe5ac24438..286e83a1be5 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Category/Indexer/Product.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Category/Indexer/Product.php @@ -311,7 +311,7 @@ public function catalogCategorySave(Mage_Index_Model_Event $event) * @return $this * @throws Zend_Db_Adapter_Exception */ - protected function _refreshNotAnchorRootCategories(array $categoryIds = null) + protected function _refreshNotAnchorRootCategories(?array $categoryIds = null) { if (empty($categoryIds)) { return $this; diff --git a/app/code/core/Mage/CatalogIndex/Model/Indexer/Eav.php b/app/code/core/Mage/CatalogIndex/Model/Indexer/Eav.php index c9d17d2bf95..bb59b2a7712 100644 --- a/app/code/core/Mage/CatalogIndex/Model/Indexer/Eav.php +++ b/app/code/core/Mage/CatalogIndex/Model/Indexer/Eav.php @@ -42,7 +42,7 @@ protected function _construct() * @param Mage_Eav_Model_Entity_Attribute_Abstract|null $attribute * @return array */ - public function createIndexData(Mage_Catalog_Model_Product $object, Mage_Eav_Model_Entity_Attribute_Abstract $attribute = null) + public function createIndexData(Mage_Catalog_Model_Product $object, ?Mage_Eav_Model_Entity_Attribute_Abstract $attribute = null) { $data = []; diff --git a/app/code/core/Mage/CatalogIndex/Model/Indexer/Interface.php b/app/code/core/Mage/CatalogIndex/Model/Indexer/Interface.php index 4f15b9cc1cd..82b4cf55a92 100644 --- a/app/code/core/Mage/CatalogIndex/Model/Indexer/Interface.php +++ b/app/code/core/Mage/CatalogIndex/Model/Indexer/Interface.php @@ -24,5 +24,5 @@ interface Mage_CatalogIndex_Model_Indexer_Interface * @param Mage_Eav_Model_Entity_Attribute_Abstract|null $attribute * @return mixed */ - public function createIndexData(Mage_Catalog_Model_Product $object, Mage_Eav_Model_Entity_Attribute_Abstract $attribute = null); + public function createIndexData(Mage_Catalog_Model_Product $object, ?Mage_Eav_Model_Entity_Attribute_Abstract $attribute = null); } diff --git a/app/code/core/Mage/CatalogIndex/Model/Indexer/Minimalprice.php b/app/code/core/Mage/CatalogIndex/Model/Indexer/Minimalprice.php index ec510f88593..07fd53d56d0 100644 --- a/app/code/core/Mage/CatalogIndex/Model/Indexer/Minimalprice.php +++ b/app/code/core/Mage/CatalogIndex/Model/Indexer/Minimalprice.php @@ -90,7 +90,7 @@ public function getPriceAttribute() * @param Mage_Eav_Model_Entity_Attribute_Abstract|null $attribute * @return array|bool */ - public function createIndexData(Mage_Catalog_Model_Product $object, Mage_Eav_Model_Entity_Attribute_Abstract $attribute = null) + public function createIndexData(Mage_Catalog_Model_Product $object, ?Mage_Eav_Model_Entity_Attribute_Abstract $attribute = null) { $searchEntityId = $object->getId(); $priceAttributeId = $this->getTierPriceAttribute()->getId(); diff --git a/app/code/core/Mage/CatalogIndex/Model/Indexer/Price.php b/app/code/core/Mage/CatalogIndex/Model/Indexer/Price.php index d76264b0328..04715b9e455 100644 --- a/app/code/core/Mage/CatalogIndex/Model/Indexer/Price.php +++ b/app/code/core/Mage/CatalogIndex/Model/Indexer/Price.php @@ -55,7 +55,7 @@ protected function _construct() * @param Mage_Eav_Model_Entity_Attribute_Abstract|null $attribute * @return array */ - public function createIndexData(Mage_Catalog_Model_Product $object, Mage_Eav_Model_Entity_Attribute_Abstract $attribute = null) + public function createIndexData(Mage_Catalog_Model_Product $object, ?Mage_Eav_Model_Entity_Attribute_Abstract $attribute = null) { $data = []; diff --git a/app/code/core/Mage/CatalogIndex/Model/Indexer/Tierprice.php b/app/code/core/Mage/CatalogIndex/Model/Indexer/Tierprice.php index 1aaa79c16d5..f3f4fd3edb7 100644 --- a/app/code/core/Mage/CatalogIndex/Model/Indexer/Tierprice.php +++ b/app/code/core/Mage/CatalogIndex/Model/Indexer/Tierprice.php @@ -68,7 +68,7 @@ protected function _construct() * @param Mage_Eav_Model_Entity_Attribute_Abstract|null $attribute * @return array */ - public function createIndexData(Mage_Catalog_Model_Product $object, Mage_Eav_Model_Entity_Attribute_Abstract $attribute = null) + public function createIndexData(Mage_Catalog_Model_Product $object, ?Mage_Eav_Model_Entity_Attribute_Abstract $attribute = null) { $data = []; diff --git a/app/code/core/Mage/Checkout/Model/Api/Resource.php b/app/code/core/Mage/Checkout/Model/Api/Resource.php index aebdaf50c69..510c821ae51 100644 --- a/app/code/core/Mage/Checkout/Model/Api/Resource.php +++ b/app/code/core/Mage/Checkout/Model/Api/Resource.php @@ -144,7 +144,7 @@ protected function _getStoreIdFromQuote($quoteId) * @param array|null $attributes * @return $this */ - protected function _updateAttributes($data, $object, $type, array $attributes = null) + protected function _updateAttributes($data, $object, $type, ?array $attributes = null) { foreach ($data as $attribute => $value) { if ($this->_isAllowedAttribute($attribute, $type, $attributes)) { @@ -163,7 +163,7 @@ protected function _updateAttributes($data, $object, $type, array $attributes = * @param array|null $attributes * @return array */ - protected function _getAttributes($object, $type, array $attributes = null) + protected function _getAttributes($object, $type, ?array $attributes = null) { $result = []; @@ -202,7 +202,7 @@ protected function _getAttributes($object, $type, array $attributes = null) * @param array|null $attributes * @return bool */ - protected function _isAllowedAttribute($attributeCode, $type, array $attributes = null) + protected function _isAllowedAttribute($attributeCode, $type, ?array $attributes = null) { if (!empty($attributes) && !(in_array($attributeCode, $attributes)) diff --git a/app/code/core/Mage/Core/Controller/Varien/Action.php b/app/code/core/Mage/Core/Controller/Varien/Action.php index d15c76b0522..f2e7ef81ada 100644 --- a/app/code/core/Mage/Core/Controller/Varien/Action.php +++ b/app/code/core/Mage/Core/Controller/Varien/Action.php @@ -613,7 +613,7 @@ public function noCookiesAction() * @param string|null $module * @param array|null $params */ - protected function _forward($action, $controller = null, $module = null, array $params = null) + protected function _forward($action, $controller = null, $module = null, ?array $params = null) { $request = $this->getRequest(); diff --git a/app/code/core/Mage/Core/Model/Url/Rewrite.php b/app/code/core/Mage/Core/Model/Url/Rewrite.php index 8340326a0c3..a9bae5f2912 100644 --- a/app/code/core/Mage/Core/Model/Url/Rewrite.php +++ b/app/code/core/Mage/Core/Model/Url/Rewrite.php @@ -207,7 +207,7 @@ public function removeTag($tags) * @throws Mage_Core_Model_Store_Exception * @deprecated since 1.7.0.2. Refactored and moved to Mage_Core_Controller_Request_Rewrite */ - public function rewrite(Zend_Controller_Request_Http $request = null, Zend_Controller_Response_Http $response = null) + public function rewrite(?Zend_Controller_Request_Http $request = null, ?Zend_Controller_Response_Http $response = null) { if (!Mage::isInstalled()) { return false; diff --git a/app/code/core/Mage/Customer/Block/Address/Renderer/Default.php b/app/code/core/Mage/Customer/Block/Address/Renderer/Default.php index 7d5ed495c87..768be5478eb 100644 --- a/app/code/core/Mage/Customer/Block/Address/Renderer/Default.php +++ b/app/code/core/Mage/Customer/Block/Address/Renderer/Default.php @@ -54,7 +54,7 @@ public function setType(Varien_Object $type) * @param Mage_Customer_Model_Address_Abstract|null $address * @return string */ - public function getFormat(Mage_Customer_Model_Address_Abstract $address = null) + public function getFormat(?Mage_Customer_Model_Address_Abstract $address = null) { $countryFormat = is_null($address) ? false diff --git a/app/code/core/Mage/Customer/Model/Api/Resource.php b/app/code/core/Mage/Customer/Model/Api/Resource.php index 1cffa839a89..4c684a1fcf7 100644 --- a/app/code/core/Mage/Customer/Model/Api/Resource.php +++ b/app/code/core/Mage/Customer/Model/Api/Resource.php @@ -42,7 +42,7 @@ class Mage_Customer_Model_Api_Resource extends Mage_Api_Model_Resource_Abstract * @param array|null $filter * @return bool */ - protected function _isAllowedAttribute($attribute, array $filter = null) + protected function _isAllowedAttribute($attribute, ?array $filter = null) { if (!is_null($filter) && !(in_array($attribute->getAttributeCode(), $filter) @@ -62,7 +62,7 @@ protected function _isAllowedAttribute($attribute, array $filter = null) * @param array|null $filter * @return array */ - public function getAllowedAttributes($entity, array $filter = null) + public function getAllowedAttributes($entity, ?array $filter = null) { $attributes = $entity->getResource() ->loadAllAttributes($entity) diff --git a/app/code/core/Mage/Dataflow/Model/Convert/Action/Abstract.php b/app/code/core/Mage/Dataflow/Model/Convert/Action/Abstract.php index e7c61b06a6e..923467a650c 100644 --- a/app/code/core/Mage/Dataflow/Model/Convert/Action/Abstract.php +++ b/app/code/core/Mage/Dataflow/Model/Convert/Action/Abstract.php @@ -123,7 +123,7 @@ public function setProfile(Mage_Dataflow_Model_Convert_Profile_Interface $profil return $this; } - public function addAction(Mage_Dataflow_Model_Convert_Action_Interface $action = null) + public function addAction(?Mage_Dataflow_Model_Convert_Action_Interface $action = null) { if (is_null($action)) { $action = new $this->_actionDefaultClass(); diff --git a/app/code/core/Mage/Dataflow/Model/Convert/Profile/Abstract.php b/app/code/core/Mage/Dataflow/Model/Convert/Profile/Abstract.php index d6c440a7cf3..cc4d6325ad4 100644 --- a/app/code/core/Mage/Dataflow/Model/Convert/Profile/Abstract.php +++ b/app/code/core/Mage/Dataflow/Model/Convert/Profile/Abstract.php @@ -34,7 +34,7 @@ abstract class Mage_Dataflow_Model_Convert_Profile_Abstract implements Mage_Data protected $_dataflow_profile = null; - public function addAction(Mage_Dataflow_Model_Convert_Action_Interface $action = null) + public function addAction(?Mage_Dataflow_Model_Convert_Action_Interface $action = null) { if (is_null($action)) { $action = new $this->_actionDefaultClass(); diff --git a/app/code/core/Mage/Dataflow/Model/Convert/Profile/Collection.php b/app/code/core/Mage/Dataflow/Model/Convert/Profile/Collection.php index 491d1ef2383..4e039562d33 100644 --- a/app/code/core/Mage/Dataflow/Model/Convert/Profile/Collection.php +++ b/app/code/core/Mage/Dataflow/Model/Convert/Profile/Collection.php @@ -70,7 +70,7 @@ public function getProfile($name) return $this->_profiles[$name]; } - public function addProfile($name, Mage_Dataflow_Model_Convert_Profile_Interface $profile = null) + public function addProfile($name, ?Mage_Dataflow_Model_Convert_Profile_Interface $profile = null) { if (is_null($profile)) { $profile = new $this->_profileDefaultClass(); diff --git a/app/code/core/Mage/Newsletter/Model/Template.php b/app/code/core/Mage/Newsletter/Model/Template.php index 95525a16751..2471f4701f6 100644 --- a/app/code/core/Mage/Newsletter/Model/Template.php +++ b/app/code/core/Mage/Newsletter/Model/Template.php @@ -284,7 +284,7 @@ public function getMail() * @return bool * @deprecated since 1.4.0.1 **/ - public function send($subscriber, array $variables = [], $name = null, Mage_Newsletter_Model_Queue $queue = null) + public function send($subscriber, array $variables = [], $name = null, ?Mage_Newsletter_Model_Queue $queue = null) { if (!$this->isValidForSend()) { return false; diff --git a/app/code/core/Mage/Oauth/Model/Server.php b/app/code/core/Mage/Oauth/Model/Server.php index 3ca44181a77..1e995726b21 100644 --- a/app/code/core/Mage/Oauth/Model/Server.php +++ b/app/code/core/Mage/Oauth/Model/Server.php @@ -658,7 +658,7 @@ public function initiateToken() * @return string * @throws Zend_Controller_Response_Exception */ - public function reportProblem(Exception $e, Zend_Controller_Response_Http $response = null) + public function reportProblem(Exception $e, ?Zend_Controller_Response_Http $response = null) { $eMsg = $e->getMessage(); diff --git a/app/code/core/Mage/Payment/Model/Recurring/Profile.php b/app/code/core/Mage/Payment/Model/Recurring/Profile.php index 2c1b1f98427..d04e8252e38 100644 --- a/app/code/core/Mage/Payment/Model/Recurring/Profile.php +++ b/app/code/core/Mage/Payment/Model/Recurring/Profile.php @@ -302,7 +302,7 @@ public function exportScheduleInfo() * @return $this * @throws Zend_Date_Exception */ - public function setNearestStartDatetime(Zend_Date $minAllowed = null) + public function setNearestStartDatetime(?Zend_Date $minAllowed = null) { // TODO: implement proper logic with invoking payment method instance $date = $minAllowed; diff --git a/app/code/core/Mage/Paypal/Model/Config.php b/app/code/core/Mage/Paypal/Model/Config.php index 8c74ac35339..af3cb556d9c 100644 --- a/app/code/core/Mage/Paypal/Model/Config.php +++ b/app/code/core/Mage/Paypal/Model/Config.php @@ -1178,7 +1178,7 @@ public function getPaymentMarkImageUrl($localeCode, $orderTotal = null, $pal = n * @param Mage_Core_Model_Locale|null $locale * @return string */ - public function getPaymentMarkWhatIsPaypalUrl(Mage_Core_Model_Locale $locale = null) + public function getPaymentMarkWhatIsPaypalUrl(?Mage_Core_Model_Locale $locale = null) { $countryCode = 'US'; if ($locale !== null) { diff --git a/app/code/core/Mage/Paypal/Model/Info.php b/app/code/core/Mage/Paypal/Model/Info.php index cd177f1f8fd..17c839d6a0e 100644 --- a/app/code/core/Mage/Paypal/Model/Info.php +++ b/app/code/core/Mage/Paypal/Model/Info.php @@ -210,7 +210,7 @@ public function importToPayment($from, Mage_Payment_Model_Info $payment) * @param array|null $map * @return array|Varien_Object */ - public function &exportFromPayment(Mage_Payment_Model_Info $payment, $to, array $map = null) + public function &exportFromPayment(Mage_Payment_Model_Info $payment, $to, ?array $map = null) { $fullMap = array_merge($this->_paymentMap, $this->_systemMap); Varien_Object_Mapper::accumulateByMap( diff --git a/app/code/core/Mage/Paypal/Model/Ipn.php b/app/code/core/Mage/Paypal/Model/Ipn.php index e13b11f44ec..665613a9124 100644 --- a/app/code/core/Mage/Paypal/Model/Ipn.php +++ b/app/code/core/Mage/Paypal/Model/Ipn.php @@ -89,7 +89,7 @@ public function getRequestData($key = null) * @param Zend_Http_Client_Adapter_Interface|null $httpAdapter * @throws Mage_Core_Exception */ - public function processIpnRequest(array $request, Zend_Http_Client_Adapter_Interface $httpAdapter = null) + public function processIpnRequest(array $request, ?Zend_Http_Client_Adapter_Interface $httpAdapter = null) { $this->_request = $request; $this->_debugData = ['ipn' => $request]; diff --git a/app/code/core/Mage/Reports/Model/Resource/Event.php b/app/code/core/Mage/Reports/Model/Resource/Event.php index b5ad2ca8c49..b2a81ecd901 100644 --- a/app/code/core/Mage/Reports/Model/Resource/Event.php +++ b/app/code/core/Mage/Reports/Model/Resource/Event.php @@ -112,7 +112,7 @@ public function applyLogToCollection( * @return array * @throws Mage_Core_Model_Store_Exception */ - public function getCurrentStoreIds(array $predefinedStoreIds = null) + public function getCurrentStoreIds(?array $predefinedStoreIds = null) { $stores = []; // get all or specified stores diff --git a/app/code/core/Mage/Review/Model/Resource/Review/Product/Collection.php b/app/code/core/Mage/Review/Model/Resource/Review/Product/Collection.php index 8bffc3e9d8d..15df70d30f0 100644 --- a/app/code/core/Mage/Review/Model/Resource/Review/Product/Collection.php +++ b/app/code/core/Mage/Review/Model/Resource/Review/Product/Collection.php @@ -131,7 +131,7 @@ public function setStoreFilter($storeId) * @param null|Zend_Db_Select $select * @return $this */ - protected function _applyStoresFilterToSelect(Zend_Db_Select $select = null) + protected function _applyStoresFilterToSelect(?Zend_Db_Select $select = null) { $adapter = $this->getConnection(); $storesIds = $this->_storesIds; diff --git a/app/code/core/Mage/Rule/Model/Resource/Rule/Collection/Abstract.php b/app/code/core/Mage/Rule/Model/Resource/Rule/Collection/Abstract.php index 5f72ee728bb..e96de3c44ad 100644 --- a/app/code/core/Mage/Rule/Model/Resource/Rule/Collection/Abstract.php +++ b/app/code/core/Mage/Rule/Model/Resource/Rule/Collection/Abstract.php @@ -173,7 +173,7 @@ protected function _getAssociatedEntityInfo($entityType) * @deprecated after 1.6.2.0 * */ - public function setEnv(Mage_Rule_Model_Environment $env = null) + public function setEnv(?Mage_Rule_Model_Environment $env = null) { $this->_env = $env; return $this; diff --git a/app/code/core/Mage/Sales/Model/Api/Resource.php b/app/code/core/Mage/Sales/Model/Api/Resource.php index 79c949c62f1..9e1617c2086 100644 --- a/app/code/core/Mage/Sales/Model/Api/Resource.php +++ b/app/code/core/Mage/Sales/Model/Api/Resource.php @@ -48,7 +48,7 @@ class Mage_Sales_Model_Api_Resource extends Mage_Api_Model_Resource_Abstract * @param array|null $attributes * @return $this */ - protected function _updateAttributes($data, $object, $type, array $attributes = null) + protected function _updateAttributes($data, $object, $type, ?array $attributes = null) { foreach ($data as $attribute => $value) { if ($this->_isAllowedAttribute($attribute, $type, $attributes)) { @@ -67,7 +67,7 @@ protected function _updateAttributes($data, $object, $type, array $attributes = * @param array|null $attributes * @return array */ - protected function _getAttributes($object, $type, array $attributes = null) + protected function _getAttributes($object, $type, ?array $attributes = null) { $result = []; @@ -104,7 +104,7 @@ protected function _getAttributes($object, $type, array $attributes = null) * @param array|null $attributes * @return bool */ - protected function _isAllowedAttribute($attributeCode, $type, array $attributes = null) + protected function _isAllowedAttribute($attributeCode, $type, ?array $attributes = null) { if (!empty($attributes) && !(in_array($attributeCode, $attributes)) diff --git a/app/code/core/Mage/Sales/Model/Quote.php b/app/code/core/Mage/Sales/Model/Quote.php index c051774cdb7..aa59600757f 100644 --- a/app/code/core/Mage/Sales/Model/Quote.php +++ b/app/code/core/Mage/Sales/Model/Quote.php @@ -458,8 +458,8 @@ public function assignCustomer(Mage_Customer_Model_Customer $customer) */ public function assignCustomerWithAddressChange( Mage_Customer_Model_Customer $customer, - Mage_Sales_Model_Quote_Address $billingAddress = null, - Mage_Sales_Model_Quote_Address $shippingAddress = null + ?Mage_Sales_Model_Quote_Address $billingAddress = null, + ?Mage_Sales_Model_Quote_Address $shippingAddress = null ) { if ($customer->getId()) { $this->setCustomer($customer); diff --git a/app/code/core/Mage/Sales/Model/Quote/Address.php b/app/code/core/Mage/Sales/Model/Quote/Address.php index b6147eb0829..beeabfbdb31 100644 --- a/app/code/core/Mage/Sales/Model/Quote/Address.php +++ b/app/code/core/Mage/Sales/Model/Quote/Address.php @@ -972,7 +972,7 @@ public function collectShippingRates() * @param Mage_Sales_Model_Quote_Item_Abstract|null $item * @return bool */ - public function requestShippingRates(Mage_Sales_Model_Quote_Item_Abstract $item = null) + public function requestShippingRates(?Mage_Sales_Model_Quote_Item_Abstract $item = null) { /** @var Mage_Shipping_Model_Rate_Request $request */ $request = Mage::getModel('shipping/rate_request'); diff --git a/app/code/core/Mage/Shipping/Model/Carrier/Abstract.php b/app/code/core/Mage/Shipping/Model/Carrier/Abstract.php index 881711361b4..af144e6827d 100644 --- a/app/code/core/Mage/Shipping/Model/Carrier/Abstract.php +++ b/app/code/core/Mage/Shipping/Model/Carrier/Abstract.php @@ -170,7 +170,7 @@ public function returnOfShipment($request) * @param Varien_Object|null $params * @return array */ - public function getContainerTypes(Varien_Object $params = null) + public function getContainerTypes(?Varien_Object $params = null) { return []; } @@ -181,7 +181,7 @@ public function getContainerTypes(Varien_Object $params = null) * @param Varien_Object|null $params * @return array|bool */ - protected function _getAllowedContainers(Varien_Object $params = null) + protected function _getAllowedContainers(?Varien_Object $params = null) { $containersAll = $this->getContainerTypesAll(); if (empty($containersAll)) { @@ -244,7 +244,7 @@ public function getCustomizableContainerTypes() * @param Varien_Object|null $params * @return array */ - public function getDeliveryConfirmationTypes(Varien_Object $params = null) + public function getDeliveryConfirmationTypes(?Varien_Object $params = null) { return []; } diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl.php index cb89380b28f..17b72682502 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl.php @@ -1325,7 +1325,7 @@ protected function _doShipmentRequest(Varien_Object $request) * @param Varien_Object|null $params * @return array|bool */ - public function getContainerTypes(Varien_Object $params = null) + public function getContainerTypes(?Varien_Object $params = null) { return $this->getCode('shipment_type'); } diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International.php index 2b2fc2a5bc0..8700e0181ed 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International.php @@ -1176,7 +1176,7 @@ protected function _showError() * @param Varien_Object|null $params * @return array */ - public function getContainerTypes(Varien_Object $params = null) + public function getContainerTypes(?Varien_Object $params = null) { return [ self::DHL_CONTENT_TYPE_DOC => Mage::helper('usa')->__('Documents'), diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Fedex.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Fedex.php index 76a64f33d3c..ee3bdb4ce14 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Fedex.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Fedex.php @@ -1550,7 +1550,7 @@ public function rollBack($data) * @param Varien_Object|null $params * @return array|bool */ - public function getContainerTypes(Varien_Object $params = null) + public function getContainerTypes(?Varien_Object $params = null) { if ($params == null) { return $this->_getAllowedContainers($params); @@ -1607,7 +1607,7 @@ public function getContainerTypesFilter() * @param Varien_Object|null $params * @return array */ - public function getDeliveryConfirmationTypes(Varien_Object $params = null) + public function getDeliveryConfirmationTypes(?Varien_Object $params = null) { return $this->getCode('delivery_confirmation_types'); } diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups.php index 102bc94a279..b886a53c52e 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups.php @@ -2028,7 +2028,7 @@ protected function _doShipmentRequestXML(Varien_Object $request): Varien_Object * @param Varien_Object|null $params * @return array|bool */ - public function getContainerTypes(Varien_Object $params = null) + public function getContainerTypes(?Varien_Object $params = null) { if ($params == null) { return $this->_getAllowedContainers($params); @@ -2112,7 +2112,7 @@ public function getContainerTypesFilter() * @param Varien_Object|null $params * @return array */ - public function getDeliveryConfirmationTypes(Varien_Object $params = null) + public function getDeliveryConfirmationTypes(?Varien_Object $params = null) { $countryRecipient = $params != null ? $params->getCountryRecipient() : null; $deliveryConfirmationTypes = []; diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Usps.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Usps.php index b7c995d0f3e..e4af94befeb 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Usps.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Usps.php @@ -1804,7 +1804,7 @@ protected function _doShipmentRequest(Varien_Object $request) * @param Varien_Object|null $params * @return array|bool */ - public function getContainerTypes(Varien_Object $params = null) + public function getContainerTypes(?Varien_Object $params = null) { if (is_null($params)) { return $this->_getAllowedContainers(); @@ -1838,7 +1838,7 @@ public function getContainerTypesFilter() * @param Varien_Object|null $params * @return array */ - public function getDeliveryConfirmationTypes(Varien_Object $params = null) + public function getDeliveryConfirmationTypes(?Varien_Object $params = null) { if ($params == null) { return []; diff --git a/composer.json b/composer.json index 663b91a6660..a63c329cfb3 100644 --- a/composer.json +++ b/composer.json @@ -7,7 +7,7 @@ ], "type": "magento-source", "require": { - "php": ">=7.4 <8.4", + "php": ">=7.4 <8.5", "ext-ctype": "*", "ext-curl": "*", "ext-dom": "*", diff --git a/composer.lock b/composer.lock index 43057d1cae4..1a60e226911 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "76dfca273981ae0e9388059e1108e257", + "content-hash": "40e9d3cfc444bb72b7cf7754c735f694", "packages": [ { "name": "colinmollenhour/cache-backend-redis", @@ -405,12 +405,12 @@ "version": "v5.2.13", "source": { "type": "git", - "url": "https://github.com/justinrainbow/json-schema.git", + "url": "https://github.com/jsonrainbow/json-schema.git", "reference": "fbbe7e5d79f618997bc3332a6f49246036c45793" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/fbbe7e5d79f618997bc3332a6f49246036c45793", + "url": "https://api.github.com/repos/jsonrainbow/json-schema/zipball/fbbe7e5d79f618997bc3332a6f49246036c45793", "reference": "fbbe7e5d79f618997bc3332a6f49246036c45793", "shasum": "" }, @@ -6392,7 +6392,7 @@ "prefer-stable": true, "prefer-lowest": false, "platform": { - "php": ">=7.4 <8.4", + "php": ">=7.4 <8.5", "ext-ctype": "*", "ext-curl": "*", "ext-dom": "*", diff --git a/lib/Varien/Convert/Profile/Abstract.php b/lib/Varien/Convert/Profile/Abstract.php index c18806d4990..dfd2d76a856 100644 --- a/lib/Varien/Convert/Profile/Abstract.php +++ b/lib/Varien/Convert/Profile/Abstract.php @@ -29,7 +29,7 @@ abstract class Varien_Convert_Profile_Abstract protected $_actionDefaultClass = 'Varien_Convert_Action'; protected $_containerCollectionDefaultClass = 'Varien_Convert_Container_Collection'; - public function addAction(Varien_Convert_Action_Interface $action = null) + public function addAction(?Varien_Convert_Action_Interface $action = null) { if (is_null($action)) { $action = new $this->_actionDefaultClass(); diff --git a/lib/Varien/Convert/Profile/Collection.php b/lib/Varien/Convert/Profile/Collection.php index 7ac0fb539e5..54134b076b1 100644 --- a/lib/Varien/Convert/Profile/Collection.php +++ b/lib/Varien/Convert/Profile/Collection.php @@ -64,7 +64,7 @@ public function getProfile($name) return $this->_profiles[$name]; } - public function addProfile($name, Varien_Convert_Profile_Abstract $profile = null) + public function addProfile($name, ?Varien_Convert_Profile_Abstract $profile = null) { if (is_null($profile)) { $profile = new $this->_profileDefaultClass(); diff --git a/lib/Varien/Db/Statement/Pdo/Mysql.php b/lib/Varien/Db/Statement/Pdo/Mysql.php index 02c5432a5d5..b23cb8435fa 100644 --- a/lib/Varien/Db/Statement/Pdo/Mysql.php +++ b/lib/Varien/Db/Statement/Pdo/Mysql.php @@ -79,7 +79,7 @@ public function _executeWithBinding(array $params) * @return bool * @throws Zend_Db_Statement_Exception */ - public function _execute(array $params = null) + public function _execute(?array $params = null) { $specialExecute = false; if ($params) {