-
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
Replace custom autoloaders with Magento's implementation #34
Comments
For Magento projects you can use
Reference - Magento For developing custom modules you need to create (copy) autoloader in your module to be able to run PHPStan without installing whole Magento. |
Thanks for pointing out. That does make sense of course. I am still undecided about how to drive this project forward as this project depends on a newer version of PHPStan compared to what Magento 2.4.0 depends on as outlined in #42. |
I think you shouldn't care which PHPStan version Magento is using as probably you don't want to test vendor code with it. I've used your package for testing project code located in app/code, we had used higher level than Magento is using and we were even patching some Magento core code to fix incorrect annotations. When you create Magento project you can simply update your dev dependencies. Also every 3rd party module should test code itself, to sum up I think you should go with latest PHPStan, not latest used by Magento. |
I just realized that we actually can't rely on Magento's autoloader for module projects because the autoloader is not shipped in one of Magento's Composer dependencies. Guess we'll have to keep our own solution for now. |
To investigate: Could we use the
Magento\Framework\TestFramework\Unit\Autoloader
implementations to generate the code and autoload it instead of our own custom logic? Or maybe reimplementMagento\Framework\Code\Generator\Autoloader
to get rid of the ObjectManager magic.The text was updated successfully, but these errors were encountered: