Skip to content
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: CQ - UnusedForeachValueToArrayKeysRector #4111

Merged
merged 10 commits into from
Sep 9, 2024

Conversation

sreichel
Copy link
Contributor

@sreichel sreichel commented Jul 22, 2024

Refactor code step by step using rector ...

See https://github.com/rectorphp/rector/blob/main/docs/rector_rules_overview.md#unusedforeachvaluetoarraykeysrector

Edit: there are some comments that state to dislike it - for personal prefs, for readability, for not having used it before ...

Imho ... it makes the code better. PHPMD will not complain about unused local variables. It makes it more readable, b/c i can see we deal only with the array keys. This sniff could be excluded, but isnt it better to make use of quality tools w/o ignore some rules?

See Rector\CodeQuality\Rector\Foreach_\UnusedForeachValueToArrayKeysRector
@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: Checkout Relates to Mage_Checkout Component: lib/Varien Relates to lib/Varien Component: Sales Relates to Mage_Sales Component: Customer Relates to Mage_Customer Component: Eav Relates to Mage_Eav Component: Adminhtml Relates to Mage_Adminhtml Component: Page Relates to Mage_Page Component: Tag Relates to Mage_Tag Component: Weee Relates to Mage_Weee Component: Shipping Relates to Mage_Shipping Component: Rule Relates to Mage_Rule Component: Payment Relates to Mage_Payment Component: Index Relates to Mage_Index Component: Api2 Relates to Mage_Api2 Component: ImportExport Relates to Mage_ImportExport Component: ConfigurableSwatches Relates to Mage_ConfigurableSwatches Component: Dataflow Relates to Mage_Dataflow Component: Install Relates to Mage_Install Component: Paygate Relates to Mage_Paygate Component: lib/* Relates to lib/* phpstan labels Jul 22, 2024
Copy link
Contributor

@addison74 addison74 left a comment

Choose a reason for hiding this comment

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

I checked visually all the changes and they are fine.

sreichel added a commit to sreichel/magento-lts that referenced this pull request Aug 7, 2024
kiatng
kiatng previously approved these changes Aug 9, 2024
addison74
addison74 previously approved these changes Aug 9, 2024
# Conflicts:
#	dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Attribute/Edit/AttributeForm.php
#	dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Prices.php
#	dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/ProductForm.php
#	dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Widget/FormTabs.php
#	dev/tests/functional/tests/app/Mage/Bundle/Test/Handler/Curl.php
#	dev/tests/functional/tests/app/Mage/Catalog/Test/TestStep/UpdateConfigurableProductStep/DeleteOptionsSubStep.php
#	dev/tests/functional/tests/app/Mage/Customer/Test/Handler/Customer/Curl.php
#	dev/tests/functional/tests/app/Mage/Weee/Test/Constraint/AssertFptApplied.php
@sreichel sreichel dismissed stale reviews from addison74 and kiatng via 00bfdb2 September 4, 2024 19:50
kiatng
kiatng previously approved these changes Sep 6, 2024
@kiatng kiatng merged commit 3257170 into OpenMage:main Sep 9, 2024
3 checks passed
@sreichel sreichel deleted the rector-1-cq branch September 9, 2024 18:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Adminhtml Relates to Mage_Adminhtml Component: Api2 Relates to Mage_Api2 Component: Catalog Relates to Mage_Catalog Component: Checkout Relates to Mage_Checkout Component: ConfigurableSwatches Relates to Mage_ConfigurableSwatches Component: Core Relates to Mage_Core Component: Customer Relates to Mage_Customer 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: Install Relates to Mage_Install Component: lib/Varien Relates to lib/Varien Component: lib/* Relates to lib/* Component: Page Relates to Mage_Page Component: Paygate Relates to Mage_Paygate Component: Payment Relates to Mage_Payment Component: PayPal Relates to Mage_Paypal Component: Reports Relates to Mage_Reports Component: Rule Relates to Mage_Rule Component: Sales Relates to Mage_Sales Component: Shipping Relates to Mage_Shipping Component: Tag Relates to Mage_Tag Component: Weee Relates to Mage_Weee phpstan
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants