From 5e8b9291136b6d8c63319b4263f4997b5827eb0f Mon Sep 17 00:00:00 2001 From: Tom J Nowell Date: Sun, 20 Sep 2026 18:03:15 +0100 Subject: [PATCH] Check PHP syntax in CI at the declared floor 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(). --- .github/workflows/ci.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 46871d7..9de2f50 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,5 +44,10 @@ jobs: - name: Install PHP dependencies run: composer install --no-interaction --prefer-dist + # PHPCompatibility 9.x predates PHP 8, so it cannot tell when the code + # uses syntax newer than the declared floor. The 8.2 parser can. + - name: Check PHP syntax + run: find button-block-icon.php inc -name '*.php' -print0 | xargs -0 -n1 php -l + - name: Lint PHP run: composer lint