Say 7.4 on the PHP badge, and make CI enforce it - #17
Merged
Conversation
The badge listed 8.1 | 8.3 | 8.4, which is the CI matrix, not what the plugin supports. It declares $plugin->phpversion = '7.4.0' and sites run it there. Changing the badge alone would move the problem rather than fix it: nothing was checking 7.4 either. moodle-plugin-ci v4 needs PHP 8, so the suite cannot run on 7.4, but a php74-syntax job now lints every file on 7.4 and fails on PHP 8 only functions, which php -l cannot see because they parse fine and fatal at runtime. The README says plainly which version is tested and which is only checked. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SrD1CtCf7ERCCtH2k7LzK3
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.
The PHP badge read
8.1 | 8.3 | 8.4. That is the CI matrix, not what the plugin supports —version.phpdeclares$plugin->phpversion = '7.4.0', and sites run it there.Now
7.4 | 8.x.Why the badge was the smaller half of the problem
Changing the text alone would have moved the inaccuracy rather than removed it: nothing was
checking 7.4 either. The plugin claimed a minimum that no job exercised, so the claim rested
on a local
php -lI happened to run during the audit.moodle-plugin-civ4 requires PHP 8, so the full suite genuinely cannot run on 7.4. What can:php -lon every file under 7.4 — catches 8.x-only syntaxstr_contains,str_starts_with,get_debug_typeand friends.
php -lcannot see these: they parse fine on 7.4 and fatal at runtime, which isthe failure mode that reaches a live site instead of a build
Both run in a new
php74-syntaxjob. I verified the guard fires on a file containingstr_contains(and passes on the current tree.Honesty in the README
The requirements section now says which version is tested and which is only checked:
That is a weaker guarantee than the badge implies on its own, and it should be stated rather
than left for someone to discover.
Testing
The new job runs on this PR — that is the verification. Locally:
php -lclean on 7.4 and 8.1,guard verified in both directions, workflow YAML parses with both jobs present.
Notes
version.php.CHANGELOG.mdand the release notes.