-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Add --strict-psr-autoloader option to install/update commands #12647
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
base: main
Are you sure you want to change the base?
Conversation
Similarly to dump-autoload, have the option to fail if any PSR violations are found.
|
I had a look regarding tests for this, they would look pretty similar to what currently exists for At least when it comes to failures as DumpAutoloadCommandTest::testFailsUsingStrictPsrIfClassMapViolationsAreFound() is pretty much the same with a different command. Looking at the DumpAutoloadCommandTest ::testUsingOptimizeAndStrictPsr() we wouldn't be able to assert by the same things as This can definitely be adjusted so that they are both expected to output similar results if we want that. |
stof
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is added in install, it should probably also be added in update for consistency.
To highlight that it is related to the autoloader.
Relates to a817163.
|
Seems reasonable to me, and I'd concur in saying tests are not needed, it'll just not test much of value. |
I noticed that
composer installdo not support--strict-psr, meaning that if you want to make use of it you would have to runinstallfollowed bydump-autoloadwith--strict-psr.Since both commands support the
optimize autoloaderoption (composer install --optimise-autoloaderorcomposer dump-autoload --optimise) it feels reasonable that both also support--strict-psr.