-
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
[PHPDOC] Fix bad phpdoc \Magento\Sales\Model\Order\Email\Container\Template::$id property #39150
base: 2.4-develop
Are you sure you want to change the base?
Conversation
Hi @dimitriBouteille. 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 |
@magento create issue |
Hi @dimitriBouteille! Is there some ongoing big effort at the moment to adopt PhpStan at certain level or something? Generally, everywhere in Magento |
Hi @orlangur Thanks for your feedback :) Today, if I want to set up PHPStan with level 5 (even worth testing a higher level) it is very complicated because the Magento code is not clean, a good part of the PHPDoc is not correct ... The best solution to implement PHPStan today is to go through bitExpert/phpstan-magento and add several ignores in PHPStan. Ignoring rules is stupid, especially when the goal is to ensure the quality of the code. I know that Magento has been around for a while and typing with PHP was complicated, but now with the arrival of PHP 8.x, we should still improve the typing. The idea is to improve PHPDoc because less cumbersome than modifying the code by adding the strict type (e.g : returns type, arguments type, ...). Decisions made some time ago are one thing, but knowing how to evolve with your time to improve the code is better ❤️ Finally, I’m not sure that adding |
Description (*)
This PR fix the bad phpdoc for
\Magento\Sales\Model\Order\Email\Container\Template::$id
, actually$id
is typeint
but in reality isstring
.For example, with PHPSTAN is very complicated to setup the project with level 5 or higher :(
Workaround
Add
@phpstan-ignore-next-line
before callsetTemplateId
:(Related Pull Requests
None
Fixed Issues (if relevant)
None
Manual testing scenarios (*)
Setup PHPSTAN with level 5 or higher and run check.
Contribution checklist (*)
Resolved issues: