-
Notifications
You must be signed in to change notification settings - Fork 25
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
missing check when using factory, di inyection and preference #224
Comments
Thanks a lot for raising this issue. This is indeed currently a problem as the di.xml files do not yet get parsed. I will need to check with the PHPStan maintainer what options we have to implement this. In your example, you could redeclare |
The possible solution will not work on this specific case as the parameter used is passed into the parent constructor. It might help in other situations. |
My current module has a preference over a class set on the di.xml file.
I'm using the factory on the constructor of a overwrite.
When using a method that only exists on the overwrited class that is created through the Factory, PHPStan reports the method as not existent.
di.xml
Class with factory on constructor:
Class B:
This is reported as:
Call to an undefined method Magento\\Framework\\View\\Page\\Config\\RendererInterface::renderExtraFooter()
Complete code has been tested and battle proven on production, so it works as expected.
For now I'm just ignoring the issue reported.
The text was updated successfully, but these errors were encountered: