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

[Issue] Fixes incorrectly cased namespace usages. #38640

Open
5 tasks
m2-assistant bot opened this issue Apr 19, 2024 · 2 comments · May be fixed by #37574
Open
5 tasks

[Issue] Fixes incorrectly cased namespace usages. #38640

m2-assistant bot opened this issue Apr 19, 2024 · 2 comments · May be fixed by #37574
Assignees
Labels
Area: Framework Component: Framework/Code Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Progress: PR in progress Reported on 2.4.x Indicates original Magento version for the Issue report. Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch

Comments

@m2-assistant
Copy link

m2-assistant bot commented Apr 19, 2024

This issue is automatically created based on existing pull request: #37574: Fixes incorrectly cased namespace usages.


Description (*)

While playing around with phpstan on level 0 on the Magento codebase, these problems showed up (among many others, but those are for another day)

$ vendor/bin/phpstan analyse --level=0 lib | grep 'referenced with incorrect case'
 3929/3929 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%

  10     Class Magento\Framework\DB\Select referenced with incorrect case: Magento\Framework\Db\Select.

$ vendor/bin/phpstan analyse --level=0 app/code/Magento | grep 'referenced with incorrect case'
 14097/14097 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%

  116    Class Magento\GiftMessage\Model\Save referenced with incorrect case: Magento\Giftmessage\Model\Save.
  12     Class Magento\Sales\Model\Order\Creditmemo\Item referenced with incorrect case: Magento\Sales\Model\Order\CreditMemo\Item.
  28     Class Magento\Framework\DB\Select referenced with incorrect case: Magento\Framework\Db\Select.
  9      Class Magento\Sales\Model\Order\Creditmemo\Item referenced with incorrect case: Magento\Sales\Model\Order\CreditMemo\Item.

This PR fixes these.
I don't think these caused real issues, I think composer's autoloader is gracefully enough to load those incorrectly cased namespaces, but let's make them correct anyways.

Related Pull Requests

Fixed Issues (if relevant)

Manual testing scenarios (*)

  1. Run vendor/bin/phpstan analyse --level=0 {some-path} | grep 'referenced with incorrect case' on all Magento code, it should not output anything (don't run this on the root the M2 codebase, otherwise it will take hours and might crash your computer if you don't have at least 32 GB of memory)
  2. Test all affected code and make sure that everything keeps working as expected (I'm assuming the automated tests will take care of this)

Questions or comments

I might fix (static) test failures if they don't turn out to be too complex to handle, but won't write new automated tests, because I think that's not relevant in scope of this PR.

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 added the Priority: P2 A defect with this priority could have functionality issues which are not to expectations. label Apr 19, 2024
@m2-assistant m2-assistant bot linked a pull request Apr 19, 2024 that will close this issue
6 tasks
@m2-community-project m2-community-project bot added this to Pull Request In Progress in High Priority Backlog Apr 19, 2024
@engcom-Charlie engcom-Charlie added Area: Framework Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Component: Framework/Code Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Reported on 2.4.x Indicates original Magento version for the Issue report. labels Apr 19, 2024
@github-jira-sync-bot
Copy link

✅ Jira issue https://jira.corp.adobe.com/browse/AC-11830 is successfully created for this GitHub issue.

Copy link
Author

m2-assistant bot commented Apr 19, 2024

✅ Confirmed by @engcom-Charlie. Thank you for verifying the issue.
Issue Available: @engcom-Charlie, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Framework Component: Framework/Code Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Progress: PR in progress Reported on 2.4.x Indicates original Magento version for the Issue report. Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch
Projects
High Priority Backlog
  
Pull Request In Progress
Development

Successfully merging a pull request may close this issue.

3 participants