Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 (!?!)
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Adminhtml/Block/Cache/Grid.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,15 @@ protected function _prepareColumns()
'type' => 'text',
'index' => 'state',
'width' => '250px',
'frame_callback' => [$this, 'decorateState'],
'frame_callback' => $this->decorateState(...),
]);

$this->addColumn('unassign', [
'header' => Mage::helper('sales')->__('Action'),
'index' => 'unassign',
'width' => '100px',
'type' => 'text',
'frame_callback' => [$this, 'decorateAction'],
'frame_callback' => $this->decorateAction(...),
'sortable' => false,
'filter' => false,
]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function getOrderStoreName()
$store->getGroup()->getName(),
$store->getName(),
];
return implode('<br/>', array_map([$this, 'escapeHtml'], $name));
return implode('<br/>', array_map($this->escapeHtml(...), $name));
}

return null;
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Adminhtml/Helper/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Api/Model/Server/Handler/Abstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Api2/Block/Adminhtml/Roles/Grid.php
Original file line number Diff line number Diff line change
Expand Up @@ -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', [
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Bundle/Model/Product/Type.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()])) {
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/CatalogRule/Model/Rule.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/CatalogSearch/Helper/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)),
);
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Core/Model/Abstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Core/Model/Cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Core/Model/Design/Package.php
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,7 @@ public function getMergedCssUrl($files)
$files,
$targetDir . DS . $targetFilename,
false,
[$this, 'beforeMergeCss'],
$this->beforeMergeCss(...),
'css',
);
if ($mergeFilesResult) {
Expand Down
4 changes: 2 additions & 2 deletions app/code/core/Mage/Core/Model/Email/Template.php
Original file line number Diff line number Diff line change
Expand Up @@ -310,8 +310,8 @@
$variables = $this->_addEmailVariables($variables, $processor->getStoreId());

$processor
->setTemplateProcessor([$this, 'getTemplateByConfigPath'])
->setIncludeProcessor([$this, 'getInclude'])
->setTemplateProcessor($this->getTemplateByConfigPath(...))

Check failure on line 313 in app/code/core/Mage/Core/Model/Email/Template.php

View workflow job for this annotation

GitHub Actions / PHPStan / Analyze

Parameter #1 $callback of method Varien_Filter_Template::setTemplateProcessor() expects array, Closure given.
->setIncludeProcessor($this->getInclude(...))
->setVariables($variables);

try {
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Core/Model/Email/Template/Filter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
Expand Down
12 changes: 6 additions & 6 deletions app/code/core/Mage/Core/Model/Resource/Session.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<?php

/**
Expand Down Expand Up @@ -127,12 +127,12 @@
{
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(...),

Check failure on line 135 in app/code/core/Mage/Core/Model/Resource/Session.php

View workflow job for this annotation

GitHub Actions / PHPStan / Analyze

Parameter #6 $gc of function session_set_save_handler expects callable(string): bool, Closure(int): bool given.
);
} else {
session_save_path(Mage::getBaseDir('session'));
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Core/Model/Url.php
Original file line number Diff line number Diff line change
Expand Up @@ -1180,7 +1180,7 @@ public function sessionUrlVar($html)
} else {
return preg_replace_callback(
'#(\?|&amp;|&)___SID=([SU])(&amp;|&)?#',
[$this, 'sessionVarCallback'],
$this->sessionVarCallback(...),
$html,
);
}
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Dataflow/Model/Convert/Iterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function walk()
$callbacks[] = $adapterCb;
}

$callbacks[] = [$this, 'updateProgress'];
$callbacks[] = $this->updateProgress(...);

echo $this->_getProgressBarHtml($sessionId, $total['cnt']);

Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Eav/Model/Entity/Abstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ public function getSortedAttributes($setId = null)
}

$this->_sortingSetId = $setId;
uasort($attributes, [$this, 'attributesCompare']);
uasort($attributes, $this->attributesCompare(...));
return $attributes;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand Down
6 changes: 3 additions & 3 deletions app/code/core/Mage/Index/Block/Adminhtml/Process/Grid.php
Original file line number Diff line number Diff line change
Expand Up @@ -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', [
Expand All @@ -131,15 +131,15 @@ protected function _prepareColumns()
'index' => 'update_required',
'type' => 'options',
'options' => $this->_processModel->getUpdateRequiredOptions(),
'frame_callback' => [$this, 'decorateUpdateRequired'],
'frame_callback' => $this->decorateUpdateRequired(...),
]);

$this->addColumn('ended_at', [
'header' => Mage::helper('index')->__('Updated At'),
'type' => 'datetime',
'align' => 'left',
'index' => 'ended_at',
'frame_callback' => [$this, 'decorateDate'],
'frame_callback' => $this->decorateDate(...),
]);

$this->addColumn(
Expand Down
4 changes: 2 additions & 2 deletions app/code/core/Mage/Newsletter/Model/Template.php
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,8 @@
$variables = $this->_addEmailVariables($variables, $processor->getStoreId());

$processor
->setTemplateProcessor([$this, 'getTemplateByConfigPath'])
->setIncludeProcessor([$this, 'getInclude'])
->setTemplateProcessor($this->getTemplateByConfigPath(...))

Check failure on line 200 in app/code/core/Mage/Newsletter/Model/Template.php

View workflow job for this annotation

GitHub Actions / PHPStan / Analyze

Parameter #1 $callback of method Varien_Filter_Template::setTemplateProcessor() expects array, Closure given.
->setIncludeProcessor($this->getInclude(...))
->setVariables($variables);

// Filter the template text so that all HTML content will be present
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
8 changes: 4 additions & 4 deletions app/code/core/Mage/Paypal/Model/Api/Abstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/**
Expand All @@ -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;
}

Expand Down Expand Up @@ -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];
Expand Down Expand Up @@ -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);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Paypal/Model/Express/Checkout.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
4 changes: 2 additions & 2 deletions app/code/core/Mage/Paypal/Model/Info.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/**
Expand All @@ -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),
);
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Rss/Block/Catalog/New.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ protected function _toHtml()
*/
Mage::getSingleton('core/resource_iterator')->walk(
$products->getSelect(),
[[$this, 'addNewItemXmlCallback']],
[$this->addNewItemXmlCallback(...)],
['rssObj' => $rssObj, 'product' => $product],
);

Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Rss/Block/Catalog/NotifyStock.php
Original file line number Diff line number Diff line change
Expand Up @@ -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],
);

Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Rss/Block/Catalog/Review.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Rss/Block/Catalog/Special.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ protected function _toHtml()
*/
Mage::getSingleton('core/resource_iterator')->walk(
$specials->getSelect(),
[[$this, 'addSpecialXmlCallback']],
[$this->addSpecialXmlCallback(...)],
['rssObj' => $rssObj, 'results' => &$results],
);

Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Rss/Block/Catalog/Tag.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
);
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Rss/Block/Order/New.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
Loading
Loading