-
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 Interface class #281
Comments
Thanks for opening your first issue in this repo :) Apparently, this is a side-effect of the extension attribute autoloader we have implemented. Since the class name ends with "Extension" the autoloader tries to generate an extension class from it. Let me check what we can do about it. I am thinking of adding the same check as for the factories. If a class by that name already exists locally or in vendor, skip the whole autoloader to generate the extension class files. |
@shochdoerfer, ah, okay, I understand. That could be the reason, indeed. Already wondered why he tries to look for an interface here. |
@norgeindian this is the check that needs to be added to both the The dependency needs to be added to the constructor and configured in the |
@shochdoerfer it seems to be an issue also when using alongside with https://github.com/phpstan/phpstan-phpunit, because https://github.com/phpstan/phpstan-phpunit/search?q=Extension Issue occurs only when there is a result cache, running with cache disabled (--debug flag) works fine. |
@makao Good catch. Apparently, I did not have that extension installed in my Magento projects. I wonder why? |
@norgeindian @makao could you people please check if the dev-master version works as expected? |
@shochdoerfer works like a charm, thanks. |
Published 0.28.0 with this issue being fixed. |
@shochdoerfer, sorry, that I opened that I opened that issue and then never replied again. We had a big launch last week, and so I did not find time for the project anymore, where this issue happened. |
When running
phpstan
in the newest version, I get the following error:In the mentioned class I only have a dependency on
Magento\MediaStorage\Model\File\Validator\NotProtectedExtension
, which definitely exists. Don't really understand how he then goes toMagento\MediaStorage\Model\File\Validator\NotProtectedInterface
.Might it be, that there is something wrong with the autoloader here?
I'm using 'bitexpert/phpstan-magento' in version
v0.27.0
andphpstan/phpstan
in version1.9.3
on Magento2.4.5-p1
.The text was updated successfully, but these errors were encountered: