-
-
Notifications
You must be signed in to change notification settings - Fork 452
rector: CatchExceptionNameMatchingTypeRector
#5015
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
rector: CatchExceptionNameMatchingTypeRector
#5015
Conversation
There was a problem hiding this 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
CatchExceptionNameMatchingTypeRectorenabled 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
|


... for