-
Notifications
You must be signed in to change notification settings - Fork 101
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
M2 Crud Model: Inspection info: invocation parameter types are not compatible with declared #476
Comments
@sallaberry Thank you! Three quick questions
|
|
sigh -- sounds like Magento's tightened-up/change their interface/contract assumptions in 2.3.1 @sallaberry Were you planning on submitting a PR for you phpcs / phpmd changes? If so, what would you be easier
|
I'll open the PR right now |
It appears the warning actually come from one of PhpStorm basic php rules, not from the official ruleset. Maybe we can ignore the warnings but PhpStorm is usually right so I'm not sure... |
@sallaberry A few more questions
|
I'm sorry if I wasn't clear enough, this is just an inspection problem. The warnings appears directly in my IDE Phpstorm which comes with his own coding standards, but if you install phpcs globally, you can point Phpstorm to the phpcs binary and use it directly from Phpstorm. (I use squizlabs/php_codesniffer installed globally) I configured phpcs inside phpstorm to use a ruleset located in Now if there's something wrong in my code and the warning comes from phpcs or phpmd, the error message is prefixed with 'phpcs:' or 'phpmd:'. It's not the case with the two messages I have. I'm sorry I didn't notice that earlier. Inside Phpstorm native code inspection configuration, I can disable specific rules, set their warning level etc. If I disable the rule: |
pestle magento2:generate:crud-model
I fixed all the issues detected by phpcs / phpmd (using Magento 2 provided rulesets) like code style, missing phpdocs and other easy to fix stuff, but I have two remaining warnings in the file :
/[..]/app/code/Namespace/Module/Model/ThingRepository.php
In the save and delete methods when calling respectively :
$this->objectResourceModel->save($object);
or
$this->objectResourceModel->delete($object);
Warning on $object :
The text was updated successfully, but these errors were encountered: