Skip to content

Conversation

@sreichel
Copy link
Contributor

... for

  • better readability
  • for PHPMD short variables (check is disabled atm)
  • unified code

@Copilot Copilot AI review requested due to automatic review settings October 20, 2025 09:59
@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: Reports Relates to Mage_Reports Component: CatalogInventory Relates to Mage_CatalogInventory Component: Checkout Relates to Mage_Checkout Component: lib/Varien Relates to lib/Varien Component: Sales Relates to Mage_Sales Component: Usa Relates to Mage_Usa Component: Customer Relates to Mage_Customer Component: Eav Relates to Mage_Eav Component: Adminhtml Relates to Mage_Adminhtml Component: ProductAlert Relates to Mage_ProductAlert Component: Api PageRelates to Mage_Api Component: Cron Relates to Mage_Cron Component: Tag Relates to Mage_Tag Component: CurrencySymbol Relates to Mage_CurrencySymbol Component: CatalogRule Relates to Mage_CatalogRule Component: Admin Relates to Mage_Admin Component: SalesRule Relates to Mage_SalesRule Component: Wishlist Relates to Mage_Wishlist Component: Widget Relates to Mage_Widget Component: Tax Relates to Mage_Tax Component: Rule Relates to Mage_Rule Component: Review Relates to Mage_Review Component: Rating Relates to Mage_Rating Component: Payment Relates to Mage_Payment labels Oct 20, 2025
@github-actions github-actions bot added 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: CatalogIndex Relates to Mage_CatalogIndex Component: Api2 Relates to Mage_Api2 Component: Log Relates to Mage_Log Component: ImportExport Relates to Mage_ImportExport Component: Directory Relates to Mage_Directory Component: ConfigurableSwatches Relates to Mage_ConfigurableSwatches Component: CatalogSearch Relates to Mage_CatalogSearch Component: Authorizenet Relates to Mage_Authorizenet Component: Centinel Relates to Mage_Centinel Component: Dataflow Relates to Mage_Dataflow Component: Install Relates to Mage_Install Component: Rss Relates to Mage_Rss Component: Paygate Relates to Mage_Paygate Component: lib/* Relates to lib/* phpunit Component: lib/Magento Relates to lib/Magento rector labels Oct 20, 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 CatchExceptionNameMatchingTypeRector to improve code readability and standardize exception variable naming across the codebase. The change renames generic exception variables (like $e) to more descriptive names that match their exception types (e.g., $mageCoreException, $throwable, $exception).

Key Changes:

  • Exception variables renamed to match their exception types throughout the codebase
  • Rector rule CatchExceptionNameMatchingTypeRector enabled in .rector.php
  • Consistent naming pattern applied across test files and production code

Reviewed Changes

Copilot reviewed 211 out of 211 changed files in this pull request and generated no comments.

Show a summary per file
File Description
.rector.php Enabled CatchExceptionNameMatchingTypeRector rule
Test files (various) Updated exception variable names in test catch blocks
Core library files Renamed exception variables to match exception types
Application code files Applied consistent exception variable naming
Controller files Updated exception handling with descriptive variable names
Model/Resource files Standardized exception variable naming
Comments suppressed due to low confidence (2)

…hingTypeRector' into rector/cs/CatchExceptionNameMatchingTypeRector
@github-actions github-actions bot added the phpmd label Oct 20, 2025
@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
8.0% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@sreichel sreichel added this to the 20.16.0 milestone Oct 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Component: Admin Relates to Mage_Admin Component: Adminhtml Relates to Mage_Adminhtml Component: Api PageRelates to Mage_Api Component: Api2 Relates to Mage_Api2 Component: Authorizenet Relates to Mage_Authorizenet Component: Bundle Relates to Mage_Bundle Component: Catalog Relates to Mage_Catalog Component: CatalogIndex Relates to Mage_CatalogIndex Component: CatalogInventory Relates to Mage_CatalogInventory Component: CatalogRule Relates to Mage_CatalogRule Component: CatalogSearch Relates to Mage_CatalogSearch Component: Centinel Relates to Mage_Centinel Component: Checkout Relates to Mage_Checkout Component: ConfigurableSwatches Relates to Mage_ConfigurableSwatches Component: Core Relates to Mage_Core Component: Cron Relates to Mage_Cron Component: CurrencySymbol Relates to Mage_CurrencySymbol Component: Customer Relates to Mage_Customer Component: Dataflow Relates to Mage_Dataflow Component: Directory Relates to Mage_Directory Component: Downloadable Relates to Mage_Downloadable Component: Eav Relates to Mage_Eav Component: ImportExport Relates to Mage_ImportExport Component: Index Relates to Mage_Index Component: Install Relates to Mage_Install Component: lib/Magento Relates to lib/Magento Component: lib/Varien Relates to lib/Varien Component: lib/* Relates to lib/* Component: Log Relates to Mage_Log Component: Newsletter Relates to Mage_Newsletter Component: Oauth Relates to Mage_Oauth Component: Paygate Relates to Mage_Paygate Component: Payment Relates to Mage_Payment Component: PayPal Relates to Mage_Paypal Component: ProductAlert Relates to Mage_ProductAlert Component: Rating Relates to Mage_Rating Component: Reports Relates to Mage_Reports Component: Review Relates to Mage_Review Component: Rss Relates to Mage_Rss Component: Rule Relates to Mage_Rule Component: Sales Relates to Mage_Sales Component: SalesRule Relates to Mage_SalesRule Component: Tag Relates to Mage_Tag Component: Tax Relates to Mage_Tax Component: Usa Relates to Mage_Usa Component: Widget Relates to Mage_Widget Component: Wishlist Relates to Mage_Wishlist phpmd phpunit rector

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant