-
-
Notifications
You must be signed in to change notification settings - Fork 355
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
[Config] Move from magic loading of all PHPStan extensions, their bootstrap files etc. under control with explicit file listing #4769
Conversation
adc50d7
to
2f41c82
Compare
e9f5669
to
d94dc15
Compare
…rap fils etc under control with explicit file listing
d94dc15
to
094fdaf
Compare
2da54d5
to
530feb2
Compare
since this PR, we have to configure rector in the "old manual way" while in tandem use PHPStan with the more comfortable autoloading way. configuring extensions manually is a mess.. the PR describes the main motivation is keeping up with PHPStan on this topic and fixing things when PHPStan moves forward.. maybe we can instead change PHPStan in a way, that rector can re-use the implementation instead of duplicate the logic. @ondrejmirtes do you agree we could add the extension installer related parts to PHPStan |
@clxmstaab Please open a GitHub issue on PHPStan's side and describe in detail what you want to achieve. |
At the start, we required explicit custom configuration for PHPStan being registered in
phpstan-for-rector.neon
.In some point we added magic loading of all phpstan extensions, like PHPStan does. The problem is, the more complex the extension became, the more feature we had to mimic from PHPStan container - rectorphp/rector#7795
Instead of continuing in this trend, we better move back to explicit registration of condig in phpstan.neon and let PHPStan container factory handle the job 👍
That way it's clear what is being used in Rector and what not.
Rector extension rules should not depend on PHPStan extension much, as they should handle upgrades of known type declaratoins. For inspiration on those rules, check https://github.com/rectorphp/rector-symfony