You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 $pageConfigRenderer in ClassA and add the correct @var annotation. That should do the trick, I would think.
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: