-
-
Notifications
You must be signed in to change notification settings - Fork 452
rector: RemoveNonExistingVarAnnotationRector
#4999
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
rector: RemoveNonExistingVarAnnotationRector
#4999
Conversation
sreichel
commented
Oct 13, 2025
- see https://getrector.com/rule-detail/remove-non-existing-var-annotation-rector
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 enables the RemoveNonExistingVarAnnotationRector in the Rector configuration to automatically clean up incorrect @var annotations that don't match their associated variables.
- Enables the Rector rule by removing it from the excluded rules list
- Applies the rule across multiple files to fix misplaced
@varannotations - Removes one unused variable declaration that had an orphaned annotation
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| .rector.php | Enables the RemoveNonExistingVarAnnotationRector by removing it from excluded rules |
| app/design/adminhtml/default/default/template/cms/browser/content/newfolder.phtml | Removes orphaned @var annotation that referenced non-existent $this variable |
| app/code/core/Mage/ProductAlert/controllers/UnsubscribeController.php | Moves @var annotations to immediately precede their corresponding variable assignments |
| app/code/core/Mage/ProductAlert/controllers/AddController.php | Repositions @var annotations and refactors assignment logic for better clarity |
| app/code/core/Mage/Catalog/Model/Resource/Abstract.php | Corrects @var annotation to reference the correct loop variable |
| app/code/core/Mage/Catalog/Block/Seo/Sitemap/Tree/Category.php | Removes unused variable and its orphaned @var annotation |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…notationRector' into rector/dc/RemoveNonExistingVarAnnotationRector
|
|
Docblocks only. Merged. |

