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
PHPCS throws a fatal error when the user passes an invalid filter:
$ bin/phpcs --filter=InvalidFilter .
PHP Fatal error: Uncaught Error: Class "\PHP_CodeSniffer\Filters\InvalidFilter" not found in src/Files/FileList.php:90
Stack trace:
#0 src/Runner.php(402): PHP_CodeSniffer\Files\FileList->__construct()
#1 src/Runner.php(120): PHP_CodeSniffer\Runner->run()
#2 bin/phpcs(14): PHP_CodeSniffer\Runner->runPHPCS()
#3 {main}
thrown in src/Files/FileList.php on line 90
Describe the solution you'd like
PHPCS should display a user-friendly error message informing the user that the filter does not exist and potentially list the available filters.
While working on this issue, it is probably worth testing the other PHPCS CLI arguments to see if there are more arguments that cause a fatal error when passed invalid input and address them as well.
Is your feature request related to a problem?
PHPCS throws a fatal error when the user passes an invalid filter:
Describe the solution you'd like
PHPCS should display a user-friendly error message informing the user that the filter does not exist and potentially list the available filters.
Additional context
Similar issue but for generators: #709.
While working on this issue, it is probably worth testing the other PHPCS CLI arguments to see if there are more arguments that cause a fatal error when passed invalid input and address them as well.
The text was updated successfully, but these errors were encountered: