Skip to content

Conversation

@sreichel
Copy link
Contributor

Copilot AI review requested due to automatic review settings October 27, 2025 05:13
@sreichel sreichel added the chore label Oct 27, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR applies Rector's FirstClassCallableRector rule, which modernizes callable syntax by converting array-based callable references to first-class callable syntax (PHP 8.1+). This improves code readability and type safety by using the ... spread operator syntax.

Key changes:

  • Converts array-based callables like [$this, 'method'] to $this->method(...)
  • Converts string callables like 'trim' to trim(...)
  • Updates static method references from [static::class, 'method'] to static::method(...)

Reviewed Changes

Copilot reviewed 71 out of 71 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
shell/indexer.php Updated array_map to use first-class callable syntax for trim
lib/Varien/Db/Adapter/Pdo/Mysql.php Converted multiple method references to first-class callable syntax
lib/Varien/Data/Collection/Filesystem.php Updated filter callback references throughout the file
lib/Mage/HTTP/Client/Socket.php Converted trim callable to first-class syntax
lib/Mage/HTTP/Client/Curl.php Converted trim callable to first-class syntax
errors/processor.php Updated strip_tags to first-class callable
cron.php Converted trim callable to first-class syntax
app/code/core/Mage/Uploader/Helper/File.php Updated method references to first-class callable syntax
app/code/core/Mage/Uploader/Block/Abstract.php Converted method reference to first-class callable
app/code/core/Mage/Sales/Model/Service/Quote.php Updated commit callbacks to first-class callable syntax
app/code/core/Mage/Sales/Model/Resource/Setup.php Converted strtoupper to first-class callable
app/code/core/Mage/Sales/Block/Order/Totals.php Refactored conditional logic to use in_array
app/code/core/Mage/Rule/Model/Condition/Product/Abstract.php Updated trim and is_numeric to first-class callables
app/code/core/Mage/Rss/Block/Order/New.php Converted nested array callback to first-class syntax
app/code/core/Mage/Rss/Block/Catalog/* Updated multiple RSS block callbacks to first-class syntax
app/code/core/Mage/Rating/Model/Resource/Rating.php Converted trim to first-class callable
app/code/core/Mage/Paypal/* Updated multiple callback references across Paypal modules
app/code/core/Mage/Paygate/Helper/Data.php Converted method reference to first-class callable
app/code/core/Mage/Oauth/Block/Adminhtml/Oauth/AuthorizedTokens/Grid.php Updated frame callbacks to first-class syntax
app/code/core/Mage/Newsletter/Model/Template.php Converted processor method references to first-class syntax
app/code/core/Mage/Index/Block/Adminhtml/Process/Grid.php Updated frame callbacks to first-class syntax
app/code/core/Mage/ImportExport/* Updated multiple callbacks and refactored conditions
app/code/core/Mage/Eav/Model/Entity/Abstract.php Converted sort callback to first-class syntax
app/code/core/Mage/Eav/Model/Attribute/Data/File.php Updated trim to first-class callable
app/code/core/Mage/Downloadable/Model/Product/Type.php Converted \intval to first-class callable
app/code/core/Mage/Dataflow/Model/Convert/Iterator.php Updated callback to first-class syntax
app/code/core/Mage/Core/Model/* Updated multiple callbacks across Core models
app/code/core/Mage/ConfigurableSwatches/Helper/* Converted static method references to first-class syntax
app/code/core/Mage/CatalogSearch/Helper/Data.php Updated method reference to first-class callable
app/code/core/Mage/CatalogRule/Model/Rule.php Converted callback to first-class syntax
app/code/core/Mage/CatalogInventory/Model/Observer.php Updated \intval to first-class callable
app/code/core/Mage/Catalog/Model/* Updated multiple callbacks and filters across Catalog models
app/code/core/Mage/Bundle/Model/Product/Type.php Converted multiple \intval references to first-class syntax
app/code/core/Mage/Api2/* Updated multiple method references to first-class syntax
app/code/core/Mage/Api/Model/* Updated callbacks and refactored conditions
app/code/core/Mage/Adminhtml/* Updated multiple frame callbacks and method references
.rector.php Removed FirstClassCallableRector from skip list

@github-actions github-actions bot added Component: PayPal Relates to Mage_Paypal Component: Core Relates to Mage_Core Component: Catalog Relates to Mage_Catalog Component: CatalogInventory Relates to Mage_CatalogInventory Component: lib/Varien Relates to lib/Varien Component: Sales Relates to Mage_Sales Component: Eav Relates to Mage_Eav Component: lib/Mage Relates to lib/Mage Component: Adminhtml Relates to Mage_Adminhtml Component: Api PageRelates to Mage_Api Component: CatalogRule Relates to Mage_CatalogRule Component: Rule Relates to Mage_Rule Component: Rating Relates to Mage_Rating Component: Oauth Relates to Mage_Oauth Component: Newsletter Relates to Mage_Newsletter Component: Index Relates to Mage_Index Component: Downloadable Relates to Mage_Downloadable Component: Bundle Relates to Mage_Bundle Component: Api2 Relates to Mage_Api2 Component: ImportExport Relates to Mage_ImportExport Component: ConfigurableSwatches Relates to Mage_ConfigurableSwatches Component: CatalogSearch Relates to Mage_CatalogSearch shell Relates to shell scripts Component: Dataflow Relates to Mage_Dataflow Component: Uploader Relates to Mage_Uploader Component: Rss Relates to Mage_Rss labels Oct 27, 2025
@github-actions github-actions bot added Component: Paygate Relates to Mage_Paygate Component: lib/* Relates to lib/* errors Relates to error pages rector labels Oct 27, 2025
# Conflicts:
#	app/code/core/Mage/Adminhtml/controllers/Sales/Order/ShipmentController.php
#	app/code/core/Mage/ImportExport/Model/Import/Entity/Abstract.php
#	app/code/core/Mage/Paypal/Model/Payflowlink.php
@github-actions github-actions bot removed Component: Catalog Relates to Mage_Catalog Component: CatalogInventory Relates to Mage_CatalogInventory Component: lib/Mage Relates to lib/Mage Component: Rule Relates to Mage_Rule Component: Rating Relates to Mage_Rating Component: Downloadable Relates to Mage_Downloadable Component: ConfigurableSwatches Relates to Mage_ConfigurableSwatches shell Relates to shell scripts errors Relates to error pages labels Oct 27, 2025
@sonarqubecloud
Copy link

@sreichel sreichel marked this pull request as draft October 27, 2025 05:40
@Hanmac
Copy link
Contributor

Hanmac commented Nov 3, 2025

When touching the callable, maybe lessen this restriction for filter_condition_callback?

if ($column->getFilterConditionCallback() && $column->getFilterConditionCallback()[0] instanceof self) {
call_user_func($column->getFilterConditionCallback(), $this->getCollection(), $column);
} else {

It stops me to add a column with filter_condition_callback via layout updates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Component: Adminhtml Relates to Mage_Adminhtml Component: Api PageRelates to Mage_Api Component: Api2 Relates to Mage_Api2 Component: Bundle Relates to Mage_Bundle Component: CatalogRule Relates to Mage_CatalogRule Component: CatalogSearch Relates to Mage_CatalogSearch Component: Core Relates to Mage_Core Component: Dataflow Relates to Mage_Dataflow Component: Eav Relates to Mage_Eav Component: ImportExport Relates to Mage_ImportExport Component: Index Relates to Mage_Index Component: lib/Varien Relates to lib/Varien Component: lib/* Relates to lib/* Component: Newsletter Relates to Mage_Newsletter Component: Oauth Relates to Mage_Oauth Component: Paygate Relates to Mage_Paygate Component: PayPal Relates to Mage_Paypal Component: Rss Relates to Mage_Rss Component: Sales Relates to Mage_Sales Component: Uploader Relates to Mage_Uploader rector

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants