diff --git a/.rector.php b/.rector.php index cfb35e6e6f5..b1981b2d304 100644 --- a/.rector.php +++ b/.rector.php @@ -52,6 +52,7 @@ CodeQuality\Class_\CompleteDynamicPropertiesRector::class, # todo: TMP (!?!) CodeQuality\Class_\InlineConstructorDefaultToPropertyRector::class, # todo: TMP CodeQuality\ClassMethod\ExplicitReturnNullRector::class, # todo: TMP + CodeQuality\ClassMethod\LocallyCalledStaticMethodToNonStaticRector::class, # todo: TMP CodeQuality\Empty_\SimplifyEmptyCheckOnEmptyArrayRector::class, # todo: TMP CodeQuality\Equal\UseIdenticalOverEqualWithSameTypeRector::class, # todo: TMP CodeQuality\Expression\InlineIfToExplicitIfRector::class, # todo: TMP (!?!) @@ -113,7 +114,6 @@ Php80\Class_\ClassPropertyAssignToConstructorPromotionRector::class, # todo: wait for php80 Php80\Class_\StringableForToStringRector::class, # todo: wait for php80 Php80\ClassMethod\AddParamBasedOnParentClassMethodRector::class, # todo: TMP - Php81\Array_\FirstClassCallableRector::class, # todo: TMP Php81\FuncCall\NullToStrictStringFuncCallArgRector::class, # todo: check later Strict\Empty_\DisallowedEmptyRuleFixerRector::class, # todo: TMP TypeDeclaration\BooleanAnd\BinaryOpNullableToInstanceofRector::class, # todo: TMP diff --git a/app/code/core/Mage/Adminhtml/Block/Cache/Grid.php b/app/code/core/Mage/Adminhtml/Block/Cache/Grid.php index 72190ea9094..9e6ed06fe65 100644 --- a/app/code/core/Mage/Adminhtml/Block/Cache/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Cache/Grid.php @@ -86,7 +86,7 @@ protected function _prepareColumns() 'index' => 'status', 'type' => 'options', 'options' => [0 => $this->__('Disabled'), 1 => $this->__('Enabled')], - 'frame_callback' => [$this, 'decorateStatus'], + 'frame_callback' => $this->decorateStatus(...), ]); return parent::_prepareColumns(); diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Status/Grid.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Status/Grid.php index 1684bbe1039..5c4103f2a4d 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Status/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Status/Grid.php @@ -62,7 +62,7 @@ protected function _prepareColumns() 'type' => 'text', 'index' => 'state', 'width' => '250px', - 'frame_callback' => [$this, 'decorateState'], + 'frame_callback' => $this->decorateState(...), ]); $this->addColumn('unassign', [ @@ -70,7 +70,7 @@ protected function _prepareColumns() 'index' => 'unassign', 'width' => '100px', 'type' => 'text', - 'frame_callback' => [$this, 'decorateAction'], + 'frame_callback' => $this->decorateAction(...), 'sortable' => false, 'filter' => false, ]); diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Info.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Info.php index 89c25d0d327..274a14cd38b 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Info.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Info.php @@ -47,7 +47,7 @@ public function getOrderStoreName() $store->getGroup()->getName(), $store->getName(), ]; - return implode('
', array_map([$this, 'escapeHtml'], $name)); + return implode('
', array_map($this->escapeHtml(...), $name)); } return null; diff --git a/app/code/core/Mage/Adminhtml/Helper/Data.php b/app/code/core/Mage/Adminhtml/Helper/Data.php index b9a1b44b5fb..ab26b3409ed 100644 --- a/app/code/core/Mage/Adminhtml/Helper/Data.php +++ b/app/code/core/Mage/Adminhtml/Helper/Data.php @@ -122,7 +122,7 @@ public function prepareFilterString($filterString) $data = []; $filterString = base64_decode($filterString); parse_str($filterString, $data); - array_walk_recursive($data, [$this, 'decodeFilter']); + array_walk_recursive($data, $this->decodeFilter(...)); return $data; } diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Allregion.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Allregion.php index 763f48438e1..8f3e0e1f708 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Allregion.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Allregion.php @@ -32,7 +32,7 @@ public function toOptionArray($isMultiselect = false) $countryRegions[$region->getCountryId()][$region->getId()] = $region->getDefaultName(); } - uksort($countryRegions, [$this, 'sortRegionCountries']); + uksort($countryRegions, $this->sortRegionCountries(...)); $this->_options = []; foreach ($countryRegions as $countryId => $regions) { diff --git a/app/code/core/Mage/Api/Model/Server/Handler/Abstract.php b/app/code/core/Mage/Api/Model/Server/Handler/Abstract.php index 5c8246e1bce..a29a5aebdc7 100644 --- a/app/code/core/Mage/Api/Model/Server/Handler/Abstract.php +++ b/app/code/core/Mage/Api/Model/Server/Handler/Abstract.php @@ -18,7 +18,7 @@ abstract class Mage_Api_Model_Server_Handler_Abstract public function __construct() { - set_error_handler([$this, 'handlePhpError'], E_ALL); + set_error_handler($this->handlePhpError(...), E_ALL); Mage::app()->loadAreaPart(Mage_Core_Model_App_Area::AREA_ADMINHTML, Mage_Core_Model_App_Area::PART_EVENTS); } diff --git a/app/code/core/Mage/Api2/Block/Adminhtml/Roles/Grid.php b/app/code/core/Mage/Api2/Block/Adminhtml/Roles/Grid.php index eb133e2ee95..3699019389f 100644 --- a/app/code/core/Mage/Api2/Block/Adminhtml/Roles/Grid.php +++ b/app/code/core/Mage/Api2/Block/Adminhtml/Roles/Grid.php @@ -59,7 +59,7 @@ protected function _prepareColumns() $this->addColumn('tole_user_type', [ 'header' => Mage::helper('oauth')->__('User Type'), 'sortable' => false, - 'frame_callback' => [$this, 'decorateUserType'], + 'frame_callback' => $this->decorateUserType(...), ]); $this->addColumn('created_at', [ diff --git a/app/code/core/Mage/Bundle/Model/Product/Type.php b/app/code/core/Mage/Bundle/Model/Product/Type.php index 7fcc6ca2bf3..4bf843f6e22 100644 --- a/app/code/core/Mage/Bundle/Model/Product/Type.php +++ b/app/code/core/Mage/Bundle/Model/Product/Type.php @@ -632,7 +632,7 @@ protected function _prepareProduct(Varien_Object $buyRequest, $product, $process $selectionIds = []; // Shuffle selection array by option position - usort($selections, [$this, 'shakeSelections']); + usort($selections, $this->shakeSelections(...)); foreach ($selections as $selection) { if ($selection->getSelectionCanChangeQty() && isset($qtys[$selection->getOptionId()])) { diff --git a/app/code/core/Mage/CatalogRule/Model/Rule.php b/app/code/core/Mage/CatalogRule/Model/Rule.php index 3c0ea5a4cb2..0b3929391a5 100644 --- a/app/code/core/Mage/CatalogRule/Model/Rule.php +++ b/app/code/core/Mage/CatalogRule/Model/Rule.php @@ -220,7 +220,7 @@ public function getMatchingProductIds() Mage::getSingleton('core/resource_iterator')->walk( $productCollection->getSelect(), - [[$this, 'callbackValidateProduct']], + [$this->callbackValidateProduct(...)], [ 'attributes' => $this->getCollectedAttributes(), 'product' => Mage::getModel('catalog/product'), diff --git a/app/code/core/Mage/CatalogSearch/Helper/Data.php b/app/code/core/Mage/CatalogSearch/Helper/Data.php index 8f67678e627..14c62100544 100644 --- a/app/code/core/Mage/CatalogSearch/Helper/Data.php +++ b/app/code/core/Mage/CatalogSearch/Helper/Data.php @@ -291,7 +291,7 @@ public function checkNotes($store = null) $wordsFull = $stringHelper->splitWords($this->getQueryText(), true); $wordsLike = $stringHelper->splitWords($this->getQueryText(), true, $this->getMaxQueryWords()); if (count($wordsFull) > count($wordsLike)) { - $wordsCut = array_map([$this, 'escapeHtml'], array_diff($wordsFull, $wordsLike)); + $wordsCut = array_map($this->escapeHtml(...), array_diff($wordsFull, $wordsLike)); $this->addNoteMessage( $this->__('Maximum words count is %1$s. In your search query was cut next part: %2$s.', $this->getMaxQueryWords(), implode(' ', $wordsCut)), ); diff --git a/app/code/core/Mage/Core/Model/Abstract.php b/app/code/core/Mage/Core/Model/Abstract.php index 5850534ad70..493234ead3d 100644 --- a/app/code/core/Mage/Core/Model/Abstract.php +++ b/app/code/core/Mage/Core/Model/Abstract.php @@ -381,7 +381,7 @@ public function save() $this->_afterSave(); } - $this->_getResource()->addCommitCallback([$this, 'afterCommitCallback']) + $this->_getResource()->addCommitCallback($this->afterCommitCallback(...)) ->commit(); $this->_hasDataChanges = false; } catch (Throwable $throwable) { diff --git a/app/code/core/Mage/Core/Model/Cache.php b/app/code/core/Mage/Core/Model/Cache.php index 3f0a655bdfc..4f5cd8e7fb9 100644 --- a/app/code/core/Mage/Core/Model/Cache.php +++ b/app/code/core/Mage/Core/Model/Cache.php @@ -241,7 +241,7 @@ protected function getDbAdapterOptions(array $options = []) $this->_dbConnection = $options['connection']; } - $options['adapter_callback'] = [$this, 'getDbAdapter']; + $options['adapter_callback'] = $this->getDbAdapter(...); $options['data_table'] = Mage::getSingleton('core/resource')->getTableName('core/cache'); $options['tags_table'] = Mage::getSingleton('core/resource')->getTableName('core/cache_tag'); return $options; diff --git a/app/code/core/Mage/Core/Model/Design/Package.php b/app/code/core/Mage/Core/Model/Design/Package.php index 1547b25f36a..7d24d31dc95 100644 --- a/app/code/core/Mage/Core/Model/Design/Package.php +++ b/app/code/core/Mage/Core/Model/Design/Package.php @@ -754,7 +754,7 @@ public function getMergedCssUrl($files) $files, $targetDir . DS . $targetFilename, false, - [$this, 'beforeMergeCss'], + $this->beforeMergeCss(...), 'css', ); if ($mergeFilesResult) { diff --git a/app/code/core/Mage/Core/Model/Email/Template.php b/app/code/core/Mage/Core/Model/Email/Template.php index a863adcd68c..45a521a83de 100644 --- a/app/code/core/Mage/Core/Model/Email/Template.php +++ b/app/code/core/Mage/Core/Model/Email/Template.php @@ -310,8 +310,8 @@ public function getProcessedTemplate(array $variables = []) $variables = $this->_addEmailVariables($variables, $processor->getStoreId()); $processor - ->setTemplateProcessor([$this, 'getTemplateByConfigPath']) - ->setIncludeProcessor([$this, 'getInclude']) + ->setTemplateProcessor($this->getTemplateByConfigPath(...)) + ->setIncludeProcessor($this->getInclude(...)) ->setVariables($variables); try { diff --git a/app/code/core/Mage/Core/Model/Email/Template/Filter.php b/app/code/core/Mage/Core/Model/Email/Template/Filter.php index faeefdc44e0..7b3f0751cfc 100644 --- a/app/code/core/Mage/Core/Model/Email/Template/Filter.php +++ b/app/code/core/Mage/Core/Model/Email/Template/Filter.php @@ -61,7 +61,7 @@ class Mage_Core_Model_Email_Template_Filter extends Varien_Filter_Template */ public function __construct() { - $this->_modifiers['escape'] = [$this, 'modifierEscape']; + $this->_modifiers['escape'] = $this->modifierEscape(...); $this->_permissionVariable = Mage::getModel('admin/variable'); $this->_permissionBlock = Mage::getModel('admin/block'); } diff --git a/app/code/core/Mage/Core/Model/Resource/Session.php b/app/code/core/Mage/Core/Model/Resource/Session.php index a4f7ac46cbf..3a6c8742b39 100644 --- a/app/code/core/Mage/Core/Model/Resource/Session.php +++ b/app/code/core/Mage/Core/Model/Resource/Session.php @@ -127,12 +127,12 @@ public function setSaveHandler() { if ($this->hasConnection()) { session_set_save_handler( - [$this, 'open'], - [$this, 'close'], - [$this, 'read'], - [$this, 'write'], - [$this, 'destroy'], - [$this, 'gc'], + $this->open(...), + $this->close(...), + $this->read(...), + $this->write(...), + $this->destroy(...), + $this->gc(...), ); } else { session_save_path(Mage::getBaseDir('session')); diff --git a/app/code/core/Mage/Core/Model/Url.php b/app/code/core/Mage/Core/Model/Url.php index 2cdf8694f61..c00f729b2b4 100644 --- a/app/code/core/Mage/Core/Model/Url.php +++ b/app/code/core/Mage/Core/Model/Url.php @@ -1180,7 +1180,7 @@ public function sessionUrlVar($html) } else { return preg_replace_callback( '#(\?|&|&)___SID=([SU])(&|&)?#', - [$this, 'sessionVarCallback'], + $this->sessionVarCallback(...), $html, ); } diff --git a/app/code/core/Mage/Dataflow/Model/Convert/Iterator.php b/app/code/core/Mage/Dataflow/Model/Convert/Iterator.php index 5392ab8d66a..bc265c9235a 100644 --- a/app/code/core/Mage/Dataflow/Model/Convert/Iterator.php +++ b/app/code/core/Mage/Dataflow/Model/Convert/Iterator.php @@ -27,7 +27,7 @@ public function walk() $callbacks[] = $adapterCb; } - $callbacks[] = [$this, 'updateProgress']; + $callbacks[] = $this->updateProgress(...); echo $this->_getProgressBarHtml($sessionId, $total['cnt']); diff --git a/app/code/core/Mage/Eav/Model/Entity/Abstract.php b/app/code/core/Mage/Eav/Model/Entity/Abstract.php index 87bd00d76c2..ac652c03d98 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Abstract.php +++ b/app/code/core/Mage/Eav/Model/Entity/Abstract.php @@ -539,7 +539,7 @@ public function getSortedAttributes($setId = null) } $this->_sortingSetId = $setId; - uasort($attributes, [$this, 'attributesCompare']); + uasort($attributes, $this->attributesCompare(...)); return $attributes; } diff --git a/app/code/core/Mage/ImportExport/Block/Adminhtml/Export/Filter.php b/app/code/core/Mage/ImportExport/Block/Adminhtml/Export/Filter.php index 30008e3f200..96cebc9c8ff 100644 --- a/app/code/core/Mage/ImportExport/Block/Adminhtml/Export/Filter.php +++ b/app/code/core/Mage/ImportExport/Block/Adminhtml/Export/Filter.php @@ -347,7 +347,7 @@ protected function _prepareColumns() 'header' => Mage::helper('importexport')->__('Filter'), 'sortable' => false, 'filter' => false, - 'frame_callback' => [$this, 'decorateFilter'], + 'frame_callback' => $this->decorateFilter(...), ]); if ($this->hasOperation()) { diff --git a/app/code/core/Mage/Index/Block/Adminhtml/Process/Grid.php b/app/code/core/Mage/Index/Block/Adminhtml/Process/Grid.php index 94b94c87f44..9965a1bfed1 100644 --- a/app/code/core/Mage/Index/Block/Adminhtml/Process/Grid.php +++ b/app/code/core/Mage/Index/Block/Adminhtml/Process/Grid.php @@ -120,7 +120,7 @@ protected function _prepareColumns() 'index' => 'status', 'type' => 'options', 'options' => $this->_processModel->getStatusesOptions(), - 'frame_callback' => [$this, 'decorateStatus'], + 'frame_callback' => $this->decorateStatus(...), ]); $this->addColumn('update_required', [ @@ -131,7 +131,7 @@ protected function _prepareColumns() 'index' => 'update_required', 'type' => 'options', 'options' => $this->_processModel->getUpdateRequiredOptions(), - 'frame_callback' => [$this, 'decorateUpdateRequired'], + 'frame_callback' => $this->decorateUpdateRequired(...), ]); $this->addColumn('ended_at', [ @@ -139,7 +139,7 @@ protected function _prepareColumns() 'type' => 'datetime', 'align' => 'left', 'index' => 'ended_at', - 'frame_callback' => [$this, 'decorateDate'], + 'frame_callback' => $this->decorateDate(...), ]); $this->addColumn( diff --git a/app/code/core/Mage/Newsletter/Model/Template.php b/app/code/core/Mage/Newsletter/Model/Template.php index 43f74f97f5b..6ab89dbd8b0 100644 --- a/app/code/core/Mage/Newsletter/Model/Template.php +++ b/app/code/core/Mage/Newsletter/Model/Template.php @@ -197,8 +197,8 @@ public function getProcessedTemplate(array $variables = [], $usePreprocess = fal $variables = $this->_addEmailVariables($variables, $processor->getStoreId()); $processor - ->setTemplateProcessor([$this, 'getTemplateByConfigPath']) - ->setIncludeProcessor([$this, 'getInclude']) + ->setTemplateProcessor($this->getTemplateByConfigPath(...)) + ->setIncludeProcessor($this->getInclude(...)) ->setVariables($variables); // Filter the template text so that all HTML content will be present diff --git a/app/code/core/Mage/Oauth/Block/Adminhtml/Oauth/AuthorizedTokens/Grid.php b/app/code/core/Mage/Oauth/Block/Adminhtml/Oauth/AuthorizedTokens/Grid.php index 43e2d598f8c..5d6d1523ba1 100644 --- a/app/code/core/Mage/Oauth/Block/Adminhtml/Oauth/AuthorizedTokens/Grid.php +++ b/app/code/core/Mage/Oauth/Block/Adminhtml/Oauth/AuthorizedTokens/Grid.php @@ -66,13 +66,13 @@ protected function _prepareColumns() 'header' => $this->__('User Type'), //'index' => array('customer_id', 'admin_id'), 'options' => [0 => $this->__('Admin'), 1 => $this->__('Customer')], - 'frame_callback' => [$this, 'decorateUserType'], + 'frame_callback' => $this->decorateUserType(...), ]); $this->addColumn('user_id', [ 'header' => $this->__('User ID'), //'index' => array('customer_id', 'admin_id'), - 'frame_callback' => [$this, 'decorateUserId'], + 'frame_callback' => $this->decorateUserId(...), ]); /** @var Mage_Adminhtml_Model_System_Config_Source_Yesno $sourceYesNo */ diff --git a/app/code/core/Mage/Paypal/Block/Adminhtml/System/Config/Fieldset/Deprecated.php b/app/code/core/Mage/Paypal/Block/Adminhtml/System/Config/Fieldset/Deprecated.php index a9154f08aff..c5bb93ede42 100644 --- a/app/code/core/Mage/Paypal/Block/Adminhtml/System/Config/Fieldset/Deprecated.php +++ b/app/code/core/Mage/Paypal/Block/Adminhtml/System/Config/Fieldset/Deprecated.php @@ -106,7 +106,7 @@ public function isPaymentEnabledAnyScope($activityPath) */ public function render(Varien_Data_Form_Element_Abstract $element) { - $isPaymentEnabled = $this->_isPaymentEnabled($element, [$this, 'isPaymentEnabledAnyScope']); + $isPaymentEnabled = $this->_isPaymentEnabled($element, $this->isPaymentEnabledAnyScope(...)); if ($this->_wasActive($element) && $isPaymentEnabled) { return parent::render($element); } diff --git a/app/code/core/Mage/Paypal/Model/Api/Abstract.php b/app/code/core/Mage/Paypal/Model/Api/Abstract.php index 8c918dadf3d..20bf89cef66 100644 --- a/app/code/core/Mage/Paypal/Model/Api/Abstract.php +++ b/app/code/core/Mage/Paypal/Model/Api/Abstract.php @@ -243,7 +243,7 @@ public function getBusinessAccount() */ public function &import($to, array $publicMap = []) { - return Varien_Object_Mapper::accumulateByMap([$this, 'getDataUsingMethod'], $to, $publicMap); + return Varien_Object_Mapper::accumulateByMap($this->getDataUsingMethod(...), $to, $publicMap); } /** @@ -254,7 +254,7 @@ public function &import($to, array $publicMap = []) */ public function export($from, array $publicMap = []) { - Varien_Object_Mapper::accumulateByMap($from, [$this, 'setDataUsingMethod'], $publicMap); + Varien_Object_Mapper::accumulateByMap($from, $this->setDataUsingMethod(...), $publicMap); return $this; } @@ -325,7 +325,7 @@ protected function &_exportToRequest(array $privateRequestMap, array $request = } } - $result = Varien_Object_Mapper::accumulateByMap([$this, 'getDataUsingMethod'], $request, $map); + $result = Varien_Object_Mapper::accumulateByMap($this->getDataUsingMethod(...), $request, $map); foreach ($privateRequestMap as $key) { if (isset($this->_exportToRequestFilters[$key]) && isset($result[$key])) { $callback = $this->_exportToRequestFilters[$key]; @@ -355,7 +355,7 @@ protected function _importFromResponse(array $privateResponseMap, array $respons } } - Varien_Object_Mapper::accumulateByMap($response, [$this, 'setDataUsingMethod'], $map); + Varien_Object_Mapper::accumulateByMap($response, $this->setDataUsingMethod(...), $map); } /** diff --git a/app/code/core/Mage/Paypal/Model/Express/Checkout.php b/app/code/core/Mage/Paypal/Model/Express/Checkout.php index 34eac5a6ee4..f085f8beae4 100644 --- a/app/code/core/Mage/Paypal/Model/Express/Checkout.php +++ b/app/code/core/Mage/Paypal/Model/Express/Checkout.php @@ -869,7 +869,7 @@ protected function _prepareShippingOptions( // Magento will transfer only first 10 cheapest shipping options if there are more than 10 available. if (count($options) > 10) { - usort($options, [static::class,'cmpShippingOptions']); + usort($options, static::cmpShippingOptions(...)); array_splice($options, 10); // User selected option will be always included in options list if (!is_null($userSelectedOption) && !in_array($userSelectedOption, $options)) { diff --git a/app/code/core/Mage/Paypal/Model/Info.php b/app/code/core/Mage/Paypal/Model/Info.php index ee175d19fe6..5657c15c603 100644 --- a/app/code/core/Mage/Paypal/Model/Info.php +++ b/app/code/core/Mage/Paypal/Model/Info.php @@ -221,7 +221,7 @@ public function importToPayment($from, Mage_Payment_Model_Info $payment) $from = [$from, 'getDataUsingMethod']; } - Varien_Object_Mapper::accumulateByMap($from, [$payment, 'setAdditionalInformation'], $fullMap); + Varien_Object_Mapper::accumulateByMap($from, $payment->setAdditionalInformation(...), $fullMap); } /** @@ -234,7 +234,7 @@ public function &exportFromPayment(Mage_Payment_Model_Info $payment, $to, ?array { $fullMap = array_merge($this->_paymentMap, $this->_systemMap); Varien_Object_Mapper::accumulateByMap( - [$payment, 'getAdditionalInformation'], + $payment->getAdditionalInformation(...), $to, $map ? $map : array_flip($fullMap), ); diff --git a/app/code/core/Mage/Rss/Block/Catalog/New.php b/app/code/core/Mage/Rss/Block/Catalog/New.php index db72334dfa0..e54e7c7469c 100644 --- a/app/code/core/Mage/Rss/Block/Catalog/New.php +++ b/app/code/core/Mage/Rss/Block/Catalog/New.php @@ -87,7 +87,7 @@ protected function _toHtml() */ Mage::getSingleton('core/resource_iterator')->walk( $products->getSelect(), - [[$this, 'addNewItemXmlCallback']], + [$this->addNewItemXmlCallback(...)], ['rssObj' => $rssObj, 'product' => $product], ); diff --git a/app/code/core/Mage/Rss/Block/Catalog/NotifyStock.php b/app/code/core/Mage/Rss/Block/Catalog/NotifyStock.php index d5c52aa03f3..484706d718a 100644 --- a/app/code/core/Mage/Rss/Block/Catalog/NotifyStock.php +++ b/app/code/core/Mage/Rss/Block/Catalog/NotifyStock.php @@ -78,7 +78,7 @@ protected function _toHtml() */ Mage::getSingleton('core/resource_iterator')->walk( $collection->getSelect(), - [[$this, 'addNotifyItemXmlCallback']], + [$this->addNotifyItemXmlCallback(...)], ['rssObj' => $rssObj, 'product' => $product, 'globalQty' => $globalNotifyStockQty], ); diff --git a/app/code/core/Mage/Rss/Block/Catalog/Review.php b/app/code/core/Mage/Rss/Block/Catalog/Review.php index be65810492d..5bb61afe5e0 100644 --- a/app/code/core/Mage/Rss/Block/Catalog/Review.php +++ b/app/code/core/Mage/Rss/Block/Catalog/Review.php @@ -65,7 +65,7 @@ protected function _toHtml() Mage::getSingleton('core/resource_iterator')->walk( $collection->getSelect(), - [[$this, 'addReviewItemXmlCallback']], + [$this->addReviewItemXmlCallback(...)], ['rssObj' => $rssObj, 'reviewModel' => $reviewModel], ); return $rssObj->createRssXml(); diff --git a/app/code/core/Mage/Rss/Block/Catalog/Special.php b/app/code/core/Mage/Rss/Block/Catalog/Special.php index d12d9958856..0d221ff76b9 100644 --- a/app/code/core/Mage/Rss/Block/Catalog/Special.php +++ b/app/code/core/Mage/Rss/Block/Catalog/Special.php @@ -90,7 +90,7 @@ protected function _toHtml() */ Mage::getSingleton('core/resource_iterator')->walk( $specials->getSelect(), - [[$this, 'addSpecialXmlCallback']], + [$this->addSpecialXmlCallback(...)], ['rssObj' => $rssObj, 'results' => &$results], ); diff --git a/app/code/core/Mage/Rss/Block/Catalog/Tag.php b/app/code/core/Mage/Rss/Block/Catalog/Tag.php index 5e622877483..cf4b012e121 100644 --- a/app/code/core/Mage/Rss/Block/Catalog/Tag.php +++ b/app/code/core/Mage/Rss/Block/Catalog/Tag.php @@ -61,7 +61,7 @@ protected function _toHtml() $resourceHelper = Mage::getResourceHelper('core'); Mage::getSingleton('core/resource_iterator')->walk( $resourceHelper->getQueryUsingAnalyticFunction($collection->getSelect()), - [[$this, 'addTaggedItemXml']], + [$this->addTaggedItemXml(...)], ['rssObj' => $rssObj, 'product' => $product], $collection->getSelect()->getAdapter(), ); diff --git a/app/code/core/Mage/Rss/Block/Order/New.php b/app/code/core/Mage/Rss/Block/Order/New.php index 1b6d5957acf..207f7a42599 100644 --- a/app/code/core/Mage/Rss/Block/Order/New.php +++ b/app/code/core/Mage/Rss/Block/Order/New.php @@ -69,7 +69,7 @@ protected function _toHtml() Mage::dispatchEvent('rss_order_new_collection_select', ['collection' => $collection]); Mage::getSingleton('core/resource_iterator') - ->walk($collection->getSelect(), [[$this, 'addNewOrderXmlCallback']], ['rssObj' => $rssObj, 'order' => $order , 'detailBlock' => $detailBlock]); + ->walk($collection->getSelect(), [$this->addNewOrderXmlCallback(...)], ['rssObj' => $rssObj, 'order' => $order , 'detailBlock' => $detailBlock]); return $rssObj->createRssXml(); } diff --git a/app/code/core/Mage/Sales/Model/Service/Quote.php b/app/code/core/Mage/Sales/Model/Service/Quote.php index b9decf63a53..be28aa32960 100644 --- a/app/code/core/Mage/Sales/Model/Service/Quote.php +++ b/app/code/core/Mage/Sales/Model/Service/Quote.php @@ -163,8 +163,8 @@ public function submitOrder() $order->setQuote($quote); $transaction->addObject($order); - $transaction->addCommitCallback([$order, 'place']); - $transaction->addCommitCallback([$order, 'save']); + $transaction->addCommitCallback($order->place(...)); + $transaction->addCommitCallback($order->save(...)); Mage::unregister('current_order'); Mage::register('current_order', $order); diff --git a/app/code/core/Mage/Uploader/Block/Abstract.php b/app/code/core/Mage/Uploader/Block/Abstract.php index 795527ce82d..ce179a908a6 100644 --- a/app/code/core/Mage/Uploader/Block/Abstract.php +++ b/app/code/core/Mage/Uploader/Block/Abstract.php @@ -235,6 +235,6 @@ public function getElementId($suffix) */ protected function _prepareElementsIds($targets) { - return array_map([$this, 'getElementId'], array_unique(array_values($targets))); + return array_map($this->getElementId(...), array_unique(array_values($targets))); } } diff --git a/app/code/core/Mage/Uploader/Helper/File.php b/app/code/core/Mage/Uploader/Helper/File.php index 74ad13edada..3f412be14b4 100644 --- a/app/code/core/Mage/Uploader/Helper/File.php +++ b/app/code/core/Mage/Uploader/Helper/File.php @@ -670,7 +670,7 @@ public function getMimeTypeFromExtensionList($extensionsList) $extensionsList = array_map(trim(...), explode(',', $extensionsList)); } - return array_map([$this, 'getMimeTypeByExtension'], $extensionsList); + return array_map($this->getMimeTypeByExtension(...), $extensionsList); } /** diff --git a/lib/Varien/Data/Collection/Filesystem.php b/lib/Varien/Data/Collection/Filesystem.php index cb71d331c7b..76d0f8e82bc 100644 --- a/lib/Varien/Data/Collection/Filesystem.php +++ b/lib/Varien/Data/Collection/Filesystem.php @@ -470,78 +470,78 @@ public function addFieldToFilter($field, $cond, $type = 'and') // simply check whether equals if (!is_array($cond)) { - return $this->addCallbackFilter($field, $cond, $type, [$this, 'filterCallbackEq']); + return $this->addCallbackFilter($field, $cond, $type, $this->filterCallbackEq(...)); } // versatile filters if (isset($cond['from']) || isset($cond['to'])) { $this->_addFilterBracket('(', 'and' === $type); if (isset($cond['from'])) { - $this->addCallbackFilter($field, $cond['from'], 'and', [$this, 'filterCallbackIsLessThan'], $inverted); + $this->addCallbackFilter($field, $cond['from'], 'and', $this->filterCallbackIsLessThan(...), $inverted); } if (isset($cond['to'])) { - $this->addCallbackFilter($field, $cond['to'], 'and', [$this, 'filterCallbackIsMoreThan'], $inverted); + $this->addCallbackFilter($field, $cond['to'], 'and', $this->filterCallbackIsMoreThan(...), $inverted); } return $this->_addFilterBracket(')'); } if (isset($cond['eq'])) { - return $this->addCallbackFilter($field, $cond['eq'], $type, [$this, 'filterCallbackEq']); + return $this->addCallbackFilter($field, $cond['eq'], $type, $this->filterCallbackEq(...)); } if (isset($cond['neq'])) { - return $this->addCallbackFilter($field, $cond['neq'], $type, [$this, 'filterCallbackEq'], $inverted); + return $this->addCallbackFilter($field, $cond['neq'], $type, $this->filterCallbackEq(...), $inverted); } if (isset($cond['like'])) { - return $this->addCallbackFilter($field, $cond['like'], $type, [$this, 'filterCallbackLike']); + return $this->addCallbackFilter($field, $cond['like'], $type, $this->filterCallbackLike(...)); } if (isset($cond['nlike'])) { - return $this->addCallbackFilter($field, $cond['nlike'], $type, [$this, 'filterCallbackLike'], $inverted); + return $this->addCallbackFilter($field, $cond['nlike'], $type, $this->filterCallbackLike(...), $inverted); } if (isset($cond['in'])) { - return $this->addCallbackFilter($field, $cond['in'], $type, [$this, 'filterCallbackInArray']); + return $this->addCallbackFilter($field, $cond['in'], $type, $this->filterCallbackInArray(...)); } if (isset($cond['nin'])) { - return $this->addCallbackFilter($field, $cond['nin'], $type, [$this, 'filterCallbackInArray'], $inverted); + return $this->addCallbackFilter($field, $cond['nin'], $type, $this->filterCallbackInArray(...), $inverted); } if (isset($cond['notnull'])) { - return $this->addCallbackFilter($field, $cond['notnull'], $type, [$this, 'filterCallbackIsNull'], $inverted); + return $this->addCallbackFilter($field, $cond['notnull'], $type, $this->filterCallbackIsNull(...), $inverted); } if (isset($cond['null'])) { - return $this->addCallbackFilter($field, $cond['null'], $type, [$this, 'filterCallbackIsNull']); + return $this->addCallbackFilter($field, $cond['null'], $type, $this->filterCallbackIsNull(...)); } if (isset($cond['moreq'])) { - return $this->addCallbackFilter($field, $cond['moreq'], $type, [$this, 'filterCallbackIsLessThan'], $inverted); + return $this->addCallbackFilter($field, $cond['moreq'], $type, $this->filterCallbackIsLessThan(...), $inverted); } if (isset($cond['gt'])) { - return $this->addCallbackFilter($field, $cond['gt'], $type, [$this, 'filterCallbackIsMoreThan']); + return $this->addCallbackFilter($field, $cond['gt'], $type, $this->filterCallbackIsMoreThan(...)); } if (isset($cond['lt'])) { - return $this->addCallbackFilter($field, $cond['lt'], $type, [$this, 'filterCallbackIsLessThan']); + return $this->addCallbackFilter($field, $cond['lt'], $type, $this->filterCallbackIsLessThan(...)); } if (isset($cond['gteq'])) { - return $this->addCallbackFilter($field, $cond['gteq'], $type, [$this, 'filterCallbackIsLessThan'], $inverted); + return $this->addCallbackFilter($field, $cond['gteq'], $type, $this->filterCallbackIsLessThan(...), $inverted); } if (isset($cond['lteq'])) { - return $this->addCallbackFilter($field, $cond['lteq'], $type, [$this, 'filterCallbackIsMoreThan'], $inverted); + return $this->addCallbackFilter($field, $cond['lteq'], $type, $this->filterCallbackIsMoreThan(...), $inverted); } if (isset($cond['finset'])) { $filterValue = ($cond['finset'] ? explode(',', $cond['finset']) : []); - return $this->addCallbackFilter($field, $filterValue, $type, [$this, 'filterCallbackInArray']); + return $this->addCallbackFilter($field, $filterValue, $type, $this->filterCallbackInArray(...)); } // add OR recursively diff --git a/lib/Varien/Db/Adapter/Pdo/Mysql.php b/lib/Varien/Db/Adapter/Pdo/Mysql.php index d7847ad8c50..642ae0d875b 100644 --- a/lib/Varien/Db/Adapter/Pdo/Mysql.php +++ b/lib/Varien/Db/Adapter/Pdo/Mysql.php @@ -1767,10 +1767,7 @@ public function describeTable($tableName, $schemaName = null) $ddl = $this->loadDdlCache($cacheKey, self::DDL_DESCRIBE); if ($ddl === false) { $ddl = array_map( - [ - $this, - 'decorateTableInfo', - ], + $this->decorateTableInfo(...), parent::describeTable($tableName, $schemaName), ); /** @@ -2369,7 +2366,7 @@ protected function _getColumnsDefinition(Varien_Db_Ddl_Table $table) // PRIMARY KEY if (!empty($primary)) { asort($primary, SORT_NUMERIC); - $primary = array_map([$this, 'quoteIdentifier'], array_keys($primary)); + $primary = array_map($this->quoteIdentifier(...), array_keys($primary)); $definition[] = sprintf(' PRIMARY KEY (%s)', implode(', ', $primary)); } @@ -3645,7 +3642,7 @@ public function insertFromSelect(Varien_Db_Select $select, $table, array $fields $query = sprintf('%s INTO %s', $query, $this->quoteIdentifier($table)); if ($fields) { - $columns = array_map([$this, 'quoteIdentifier'], $fields); + $columns = array_map($this->quoteIdentifier(...), $fields); $query = sprintf('%s (%s)', $query, implode(', ', $columns)); } @@ -3971,7 +3968,7 @@ protected function _prepareInsertData($row, &$bind) protected function _getInsertSqlQuery($tableName, array $columns, array $values) { $tableName = $this->quoteIdentifier($tableName, true); - $columns = array_map([$this, 'quoteIdentifier'], $columns); + $columns = array_map($this->quoteIdentifier(...), $columns); $columns = implode(',', $columns); $values = implode(', ', $values);