Skip to content

Check PHP syntax in CI at the declared floor - #4

Merged
jdbg merged 1 commit into
mainfrom
ci-php-syntax-check
Sep 20, 2026
Merged

jdbg merged 1 commit into
mainfrom
ci-php-syntax-check

Conversation

@tomjn

@tomjn tomjn commented Sep 20, 2026

Copy link
Copy Markdown
Contributor

#2 moved the PHPCS testVersion to 8.2, but the PHPCompatibility release in the lock is 9.3.5, which predates PHP 8. A file with a typed class constant passes it. This adds a php -l pass on the 8.2 runner, which does catch that.

It only catches syntax. A newer function such as json_validate() still gets through, and closing that needs PHPCompatibility 10, which has no stable release.

The PHPCompatibility release in the lock is 9.3.5, which has no PHP 8 sniffs. A file using a typed class constant passes it with testVersion 8.2-. Parsing each file with the 8.2 binary catches syntax the floor does not support. It does not catch newer functions such as json_validate().
@jdbg
jdbg merged commit 922c747 into main Sep 20, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants