Skip to content

[Issue] Small cleanup, removed duplicated keys from array #39851

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

Open
2 of 5 tasks
m2-assistant bot opened this issue Apr 22, 2025 · 0 comments · May be fixed by #39844
Open
2 of 5 tasks

[Issue] Small cleanup, removed duplicated keys from array #39851

m2-assistant bot opened this issue Apr 22, 2025 · 0 comments · May be fixed by #39844
Labels
Issue: ready for confirmation Reported on 2.4.x Indicates original Magento version for the Issue report. Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it

Comments

@m2-assistant
Copy link

m2-assistant bot commented Apr 22, 2025

This issue is automatically created based on existing pull request: #39844: Small cleanup, removed duplicated keys from array


Description (*)

The constants ColumnResolver::COLUMN_WEIGHT and ColumnResolver::COLUMN_WEIGHT_DESTINATION both have the same value 'Weight (and above)'

So adding those both to an array as key makes no sense.

I assume one of both was added at a later point (probably in Magento1 times) and it was forgotten to cleanup the old one.

So that's what I'm doing here. I've left both constants in place just in case somebody does use both of them. But using both in the Magento codebase makes no sense.

It's another effort in trying to get phpstan to run on level 0 on the entire codebase without errors. This only fixes 2 small warnings, but it's a small step forward nonetheless.

Related Pull Requests

Fixed Issues (if relevant)

N/A

Manual testing scenarios (*)

  1. Run phpstan analysis:
$ ./vendor/bin/phpstan analyse --level=0 -c dev/tests/static/testsuite/Magento/Test/Php/_files/phpstan/phpstan.neon app/code/Magento/ | grep 'duplicate keys'
 14491/14491 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%

  26     Array has 2 duplicate keys with value 'Weight (and above)' (\Magento\OfflineShipping\Model\ResourceModel\Carrier\Tablerate\CSV\ColumnResolver::COLUMN_WEIGHT,
  91     Array has 2 duplicate keys with value 'Weight (and above)' (\Magento\OfflineShipping\Model\ResourceModel\Carrier\Tablerate\CSV\ColumnResolver::COLUMN_WEIGHT,
  1. Expected is no errors

Questions or comments

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • README.md files for modified modules are updated and included in the pull request if any README.md predefined sections require an update
  • All automated tests passed successfully (all builds are green)
@m2-assistant m2-assistant bot linked a pull request Apr 22, 2025 that will close this issue
6 tasks
@github-project-automation github-project-automation bot moved this to Ready for Confirmation in Issue Confirmation and Triage Board Apr 22, 2025
@engcom-Bravo engcom-Bravo added Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it Reported on 2.4.x Indicates original Magento version for the Issue report. labels Apr 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue: ready for confirmation Reported on 2.4.x Indicates original Magento version for the Issue report. Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it
Projects
Status: Ready for Confirmation
Development

Successfully merging a pull request may close this issue.

1 participant