You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just discovered that composer validate will pass even if there are PSR-4 problems. That's not the fault of GrumPHP, but it may be misleading.
Steps to reproduce/Result:
Given a Composer project with PSR-4 configured and GrumPHP installed, just put a class file in the wrong directory and...
# `composer validate` reports nothing and returns a success status code.
$ validate; echo $?
./composer.json is valid
0
# `composer dumpautoload` reports the error and returns a failure code given the `--strict-psr` option.
$ composer dumpautoload --strict-psr 1> /dev/null; echo $? # (Silence stdout for clarity.)
Class Example\Good located in ./src/Bad.php does not comply with psr-4 autoloading standard. Skipping.
1
Proposal:
Either add a new task (or an option to the existing composer task), to use composer dumpautoload to check PSR-4 violations.
The text was updated successfully, but these errors were encountered:
Hmm interesting.
The dump autoload changes files, which might not be the wanted scenario here.
Maybe it could make sense for composer to add this check to the validation command somehow?
v1.16.0
I just discovered that
composer validate
will pass even if there are PSR-4 problems. That's not the fault of GrumPHP, but it may be misleading.Steps to reproduce/Result:
Given a Composer project with PSR-4 configured and GrumPHP installed, just put a class file in the wrong directory and...
Proposal:
Either add a new task (or an option to the existing
composer
task), to usecomposer dumpautoload
to check PSR-4 violations.The text was updated successfully, but these errors were encountered: