llaville / php-compatinfo

Library that find out the minimum version and the extensions required for a piece of code to run
https://llaville.github.io/php-compatinfo/7.1/
Other
371 stars 21 forks source link

TrailingCommaSniff give wrong results #348

Closed llaville closed 2 years ago

llaville commented 2 years ago

Bug report category

Diagnose

Output of `diagnose` command ``` Requirements Checker ==================== > Running PHP CompatInfo with PHP 7.4.28 on Linux 4.19.128-microsoft-standard > PHP is using the following php.ini file: WARNING: No configuration file (php.ini) used by PHP! > Checking PHP CompatInfo requirements: [x] PHP version must be at least 7.4.0 [x] pdo_sqlite extension must be available [x] Check if source "/home/devilbox/.cache/bartlett/compatinfo-db.sqlite" can be reached [x] Check if tables exists in database [x] Check if database contains at least one distribution platform ? Environment > [APP_ENV] prod > [APP_DATABASE_URL] sqlite:////home/devilbox/.cache/bartlett/compatinfo-db.sqlite > [APP_PROXY_DIR] /tmp/bartlett/php-compatinfo-db/4.1.0@b8969ae/proxies > [APP_VENDOR_DIR] /shared/backups/bartlett/php-compatinfo/vendor > [APP_CACHE_DIR] /home/devilbox/.cache/bartlett > [APP_HOME_DIR] /home/devilbox [OK] Your system is ready to run the application. ! [NOTE] phpCompatInfo version 6.3.x-dev@efd410d DB version 4.1.0@b8969ae ```

Summary

When trying to detect trailing comma PHP feature that come with PHP 8.0, the TrailingCommaSniff fails to detect good results.

Expected behaviour

Expected PHP min value

Actual behaviour

Wrong PHP min value : given PHP 8.0.0alpha1

Feature issue.

Trailing comma

Source Code Analysis issue.

Source Code reference: https://github.com/laminas/laminas-mail/releases/tag/2.16.0

Thanks to @remicollet for issue #345 that allow me to found this bug !