-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
#38365: Fixed wrong type for InvalidArgumentException
to avoid fatal error
#38366
base: 2.4-develop
Are you sure you want to change the base?
#38365: Fixed wrong type for InvalidArgumentException
to avoid fatal error
#38366
Conversation
…id fatal error
Hi @andrewbess. Thank you for your contribution! Add the comment under your pull request to deploy test or vanilla Magento instance:
❗ Automated tests can be triggered manually with an appropriate comment:
Allowed build names are:
You can find more information about the builds here For more details, review the Code Contributions documentation. |
@magento run all tests |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues. |
May I suggest a different solution. I think somebody by mistake used If I search the entire codebase for |
Thank you @hostep for your suggestion |
We have failed static test here. |
@andrewbess if it's not used, why should we touch it? |
Just one extra thought around the the I'm a fan of using PHPstan is able to detect this bug, but you need to use level 5 and I believe the static tests used by Magento only run on level 0 or 1:
So another way to find violations in the current codebase would be to run something like this:
Executing this on the Around my last comment, I'm maybe a bit worried about breaking backwards compatibility if we change types of exceptions, users may be surprised that the type changed. So maybe we do need to keep them as-is and just explicitly cast the Phrases to a string, by using |
Description (*)
This pull request (PR) provides fixes for store resolver to avoid fatal error when system tries to throw InvalidArgumentException with message: "Invalid store parameter."
Fixed Issues (if relevant)
Manual testing scenarios (*)
$_COOKIE['store'] = ['test'];
Questions or comments
Contribution checklist (*)