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
Introduce an option of dump-autoload
to fail on PSR uncompliant classes
#10241
Comments
This is really not so trivial to add IMO.. So sounds like not really worth the trouble to me. I think it could be done by propagating a list of warnings all the way through AutoloadGenerator::dump and its children and into ClassMapGenerator too, so that DumpAutoloadCommand could easily retreive warnings and exit differently if --strict is passed in for example. |
@Seldaek maybe introduce a |
Agreed, and I'd like to see this option anywhere that a warning can be generated. For instance, you can get the PSR-4 warnings on |
Yeah I got a possible solution in the works - hopefully can wrap this up next week |
…lations were detected, fixes composer#10241
See #10886 |
…lations were detected, fixes composer#10241
@Seldaek thank you so much for your work! Looking forward to a stable release to test it out! |
You can give it a shot with "composer self-update --snapshot" already |
Thanks! We've already implemented this in our CI to catch tests with bad class names that Composer would otherwise fail to load: acquia/cli#1070 |
…lations were detected, fixes composer#10241 (composer#10886)
I would like to suggest adding an option to the
dump-autoload
command which would force it to fail when it encounters PSR uncompliant classes. This would be very profitable to add this kind of validation to the CI scripts.Currently, the command just prints to the stdout notices like the following but the return code is always
0
thus there's no straightforward way to automate this important validation process.The text was updated successfully, but these errors were encountered: