Add --strict-psr-autoloader option to install/update commands#12647
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.
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. |
Co-authored-by: Jordi Boggiano <[email protected]>
|
Thanks |
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.