Skip to content

Conversation

@sreichel
Copy link
Contributor

Copilot AI review requested due to automatic review settings October 13, 2025 22:49
@sreichel sreichel added the chore label Oct 13, 2025
@github-actions github-actions bot added Component: Catalog Relates to Mage_Catalog Template : admin Relates to admin template Component: Cms Relates to Mage_Cms Component: Adminhtml Relates to Mage_Adminhtml Component: ProductAlert Relates to Mage_ProductAlert rector labels Oct 13, 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 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 @var annotations
  • 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

sreichel and others added 3 commits October 14, 2025 00:50
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…notationRector' into rector/dc/RemoveNonExistingVarAnnotationRector
@github-actions github-actions bot added the Component: Eav Relates to Mage_Eav label Oct 13, 2025
@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

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

See analysis details on SonarQube Cloud

@sreichel
Copy link
Contributor Author

Docblocks only. Merged.

@sreichel sreichel merged commit abd1281 into OpenMage:main Oct 13, 2025
20 of 21 checks passed
@sreichel sreichel deleted the rector/dc/RemoveNonExistingVarAnnotationRector branch October 13, 2025 23:11
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: Catalog Relates to Mage_Catalog Component: Cms Relates to Mage_Cms Component: Eav Relates to Mage_Eav Component: ProductAlert Relates to Mage_ProductAlert phpstan rector Template : admin Relates to admin template

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant