overtrue / phplint

:bug: A tool that can speed up linting of php files by running several lint processes at once.
MIT License
988 stars 88 forks source link

PHPLint 9.1.1 is unable to interpret correctly command arguments/options #204

Closed llaville closed 9 months ago

llaville commented 9 months ago

New Issue

Summary

After fixing issue #203, I've tested new PHAR version built with BOX v6 with following command bin/phplint.phar --progress -vvv

Expected behaviour

Should print a RuntimeException with message The "--progress" option requires a value

Actual behaviour


Box Requirements Checker
========================

> Using PHP 8.2.15
> PHP is not using any php.ini file.

> Checking Box requirements:
  ✔ This application requires a PHP version matching "^8.1".
  ✔ This application requires the extension "dom".
  ✔ This application requires the extension "json".
  ✔ This application requires the extension "zlib".
  ✔ The package "symfony/service-contracts" conflicts with the extension "psr".

 [OK] Your system is ready to run the application.

Fatal error: Uncaught UnhandledMatchError: Unhandled match case '-vvv' in phar:///shared/backups/github/phplint/bin/phplint.phar/bin/phplint on line 23

UnhandledMatchError: Unhandled match case '-vvv' in phar:///shared/backups/github/phplint/bin/phplint.phar/bin/phplint on line 23

Call Stack:
    0.0025    2828696   1. {main}() /shared/backups/github/phplint/bin/phplint.phar:0
    0.0114    3173208   2. require('phar:///shared/backups/github/phplint/bin/phplint.phar/bin/phplint') /shared/backups/github/phplint/bin/phplint.phar:18

While with PHPLint 9.0.8, and same command we got expected results :


Box Requirements Checker
========================

> Using PHP 8.2.15
> PHP is not using any php.ini file.

> Checking Box requirements:
  ✔ This application requires a PHP version matching "^8.0".
  ✔ This application requires the extension "json".
  ✔ The package "symfony/service-contracts" conflicts with the extension "psr".

 [OK] Your system is ready to run the application.

In ArgvInput.php line 223:

  [_HumbugBoxd58362ef9979\Symfony\Component\Console\Exception\RuntimeException]
  The "--progress" option requires a value.

Exception trace:
  at phar:///shared/backups/php/phplint-9.0.phar/vendor/symfony/console/Input/ArgvInput.php:223
 _HumbugBoxd58362ef9979\Symfony\Component\Console\Input\ArgvInput->addLongOption() at phar:///shared/backups/php/phplint-9.0.phar/vendor/symfony/console/Input/ArgvInput.php:136
 _HumbugBoxd58362ef9979\Symfony\Component\Console\Input\ArgvInput->parseLongOption() at phar:///shared/backups/php/phplint-9.0.phar/vendor/symfony/console/Input/ArgvInput.php:77
 _HumbugBoxd58362ef9979\Symfony\Component\Console\Input\ArgvInput->parseToken() at phar:///shared/backups/php/phplint-9.0.phar/vendor/symfony/console/Input/ArgvInput.php:67
 _HumbugBoxd58362ef9979\Symfony\Component\Console\Input\ArgvInput->parse() at phar:///shared/backups/php/phplint-9.0.phar/vendor/symfony/console/Input/Input.php:52
 _HumbugBoxd58362ef9979\Symfony\Component\Console\Input\Input->bind() at phar:///shared/backups/php/phplint-9.0.phar/vendor/symfony/console/Command/Command.php:249
 _HumbugBoxd58362ef9979\Symfony\Component\Console\Command\Command->run() at phar:///shared/backups/php/phplint-9.0.phar/vendor/symfony/console/Application.php:915
 _HumbugBoxd58362ef9979\Symfony\Component\Console\Application->doRunCommand() at phar:///shared/backups/php/phplint-9.0.phar/vendor/symfony/console/Application.php:280
 _HumbugBoxd58362ef9979\Symfony\Component\Console\Application->doRun() at phar:///shared/backups/php/phplint-9.0.phar/src/Console/Application.php:51
 _HumbugBoxd58362ef9979\Overtrue\PHPLint\Console\Application->doRun() at phar:///shared/backups/php/phplint-9.0.phar/vendor/symfony/console/Application.php:163
 _HumbugBoxd58362ef9979\Symfony\Component\Console\Application->run() at phar:///shared/backups/php/phplint-9.0.phar/src/Console/Application.php:41
 _HumbugBoxd58362ef9979\Overtrue\PHPLint\Console\Application->run() at phar:///shared/backups/php/phplint-9.0.phar/bin/phplint:44
 require() at /shared/backups/php/phplint-9.0.phar:17

lint [--exclude EXCLUDE] [--extensions EXTENSIONS] [-j|--jobs JOBS] [-c|--configuration CONFIGURATION] [--no-configuration] [--cache CACHE] [--no-cache] [-p|--progress PROGRESS] [--no-progress] [--log-json [LOG-JSON]] [--log-junit [LOG-JUNIT]] [-w|--warning] [--memory-limit MEMORY-LIMIT] [--ignore-exit-code] [--] [<path>...]