Skip to content
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

Deprecated Config Option autoload_files #40

Closed
sprankhub opened this issue Jun 15, 2020 · 3 comments
Closed

Deprecated Config Option autoload_files #40

sprankhub opened this issue Jun 15, 2020 · 3 comments
Milestone

Comments

@sprankhub
Copy link
Contributor

When using the current dev-master and using the recommended configuration from the README.md, there is a deprecation warning when running PHPStan:

Note: Using configuration file /var/www/project/phpstan.neon.
⚠️  You're using a deprecated config option autoload_files. ⚠️️

You might not need it anymore - try removing it from your
configuration file and run PHPStan again.

If the analysis fails, there are now two distinct options
to choose from to replace autoload_files:
1) scanFiles - PHPStan will scan those for classes and functions
   definitions. PHPStan will not execute those files.
2) bootstrapFiles - PHPStan will execute these files to prepare
   the PHP runtime environment for the analysis.

Read more about this in PHPStan's documentation:
https://phpstan.org/user-guide/discovering-symbols

Removing the option altogether does not work for me, because I get the error "Call to static method getObjectManager() on an unknown class Magento\TestFramework\Helper\Bootstrap" again in this case.

@shochdoerfer
Copy link
Member

Thanks for letting us know. Seems like the autoload_files option got deprecated with PHPStan 0.12.26. Removing autoload_files won't work as the file contains the logic to register the custom autoloaders.

Could you try to rename autoload_files to bootstrapFiles and see if things are working again?

@sprankhub
Copy link
Contributor Author

This indeed seems to work :)

@shochdoerfer
Copy link
Member

Ok, that was easy then ;) Had the impression that both parameters worked differently when I read the docs back then. Good to know that it is just a "minor" change.

shochdoerfer added a commit that referenced this issue Jun 15, 2020
Remove deprecated phpstan parameter, fixes #40
@shochdoerfer shochdoerfer added this to the 0.4.0 milestone Jun 15, 2020
convenient added a commit to convenient/phpstan-magento2-magic-methods that referenced this issue Apr 27, 2021
bitExpert/phpstan-magento#40 (comment)

> Seems like the autoload_files option got deprecated with PHPStan 0.12.26. Removing autoload_files won't work as the file contains the logic to register the custom autoloaders
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants