Repository navigation
Add php-lint.sh: syntax check on other PHP versions in Docker - #28
Merged
Merged
Conversation
Lints every PHP file of an extension with `php -l` under one or more PHP versions (default 7.4 and 8.4), each in a throwaway container from the official php:VERSION-cli image, with the folder mounted read-only and no network. This checks an extension against its minimum PHP version without that PHP being installed locally. Compile-time deprecation notices are shown, and fail the run with --strict. Adds its option tests, the ShellCheck run in CI and a README section. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
phpbb-test-board/php-lint.sh, a syntax check of an extension under other PHP versions, run in Docker.phpbbmodders extensions support PHP 7.4, but PHP 7.4 isn't installed on the machine used for testing, so the only 7.4 check was the lint job in each extension's CI. This script runs that check locally without installing PHP 7.4.
What it does
php -lon every PHP file in a folder under each PHP version given with-p(default7.4,8.4, the versions the extensions'lint.ymluses).php:VERSION-cliimage. The folder is mounted read-only, the container has no network, and it is removed when it exits.vendor/,node_modules/and.git/.--strict.MAJOR.MINORversions, so nothing else can end up in the image name.Also adds its option tests to
tests/test-phpbb-test-board.sh, adds the script to the CI ShellCheck run, and documents it in the phpbb-test-board README.Testing
Claude ran it on:
--strict.?->call fails on 7.4 with the parse error, an implicitly nullable parameter shows the 8.4 deprecation and fails with--strict, and a broken file undervendor/is skipped.ShellCheck is clean and
tests/test-phpbb-test-board.shpasses, including the new php-lint.sh cases. No containers were left behind.Investigated and written by Claude on behalf of William Jacoby (bonelifer).
🤖 Generated with Claude Code