Support PHP 7.4–8.5 and upgrade dev tooling#73
Merged
Conversation
Widen the PHP constraint to 7.4–8.5 and bump the dev toolchain: PHPUnit 9, PHP_CodeSniffer 4, graze/standards 3, Mockery 1.6. - composer.json: php "^7.4 || ^8.0"; phpunit ^9; php_codesniffer ^4; graze/standards ^3; mockery ^1.6; var-dumper "^4.2 || ^5.0". - Tests migrated to PHPUnit 9 APIs: @ExpectedException annotations converted to expectException(), assertRegExp -> assertMatchesRegularExpression, assertInternalType('array') -> assertIsArray. - phpunit.xml.dist migrated to the v9 schema (coverage/include). - PHP 8 cleanliness: cast strcasecmp() args in Token::eq(); replace ${var} string interpolation in tests; guard ReflectionProperty::setAccessible() behind PHP_VERSION_ID < 80100. - CI matrix now covers PHP 7.4, 8.0, 8.1, 8.2, 8.3, 8.4, 8.5. --prefer-lowest runs on 7.4 only, since the lowest supported runtime deps predate PHP 8. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR widens the library’s PHP compatibility range and updates the development/test tooling needed to run cleanly across PHP 7.4 through newer PHP 8.x versions.
Changes:
- Updates Composer PHP/dev-tool constraints and lockfile dependencies for PHPUnit 9, PHPCS 4, graze/standards 3, Mockery 1.6, and newer Symfony tooling.
- Migrates PHPUnit tests/configuration away from removed/deprecated PHPUnit APIs and PHP 8.5 deprecations.
- Expands CI coverage across PHP 7.4 and PHP 8.0–8.5, with lowest-dependency testing limited to PHP 7.4.
Reviewed changes
Copilot reviewed 11 out of 12 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
.github/workflows/ci.yml |
Expands the PHP matrix and keeps --prefer-lowest on PHP 7.4 only. |
composer.json |
Widens PHP support and upgrades development dependency constraints. |
composer.lock |
Updates locked dependency versions for the new toolchain. |
phpunit.xml.dist |
Migrates PHPUnit configuration to the newer coverage schema. |
src/Parse/Token.php |
Avoids null-to-string deprecation by casting strcasecmp() arguments. |
tests/Parse/CollationInfoTest.php |
Replaces expected-exception annotations with PHPUnit API calls. |
tests/Parse/ColumnDefinitionTest.php |
Replaces expected-exception annotations with PHPUnit API calls. |
tests/Parse/CreateDatabaseTest.php |
Migrates assertions and expected-exception handling for PHPUnit 9. |
tests/Parse/CreateTableTest.php |
Replaces deprecated regex assertion with PHPUnit 9 equivalent. |
tests/Parse/TableOptionsTest.php |
Replaces expected-exception annotation with PHPUnit API call. |
tests/Parse/TokenStreamTest.php |
Updates PHPUnit exception handling, interpolation syntax, and reflection accessibility handling. |
tests/Parse/TokenTest.php |
Updates interpolation syntax and expected-exception handling. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Add a Requirements section and note `make test PHP_VER=` for targeting a specific PHP version. - Replace the stale Travis badge with the GitHub Actions CI badge. - Remove the Scrutinizer (coverage/quality), MicroBadger badges and the imgur banner image, which are no longer used. - Drop the dead Scrutinizer coverage upload from CI and disable coverage in setup-php since nothing consumes it. Co-Authored-By: Claude Opus 4.8 (1M context) <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.
Summary
Widens the supported PHP range to 7.4 through 8.5 and upgrades the dev toolchain to PHPUnit 9, PHP_CodeSniffer 4, graze/standards 3, and Mockery 1.6.
Changes
composer.jsonphp:^7.4→^7.4 || ^8.0phpunit/phpunit:^8→^9squizlabs/php_codesniffer:^3.5.0→^4.0graze/standards:^2.0→^3.0mockery/mockery:^1.2→^1.6symfony/var-dumper(dev):^4.2→^4.2 || ^5.0Tests — PHPUnit 9 API migration (removed APIs the suite relied on)
@expectedExceptionannotations →$this->expectException(...)assertRegExp→assertMatchesRegularExpressionassertInternalType('array', …)→assertIsArray(…)phpunit.xml.dist— migrated to the v9 schema (<filter><whitelist>→<coverage><include>).PHP 8 cleanliness (zero deprecations across 7.4→8.5)
Token::eq(): caststrcasecmp()args to string (null-to-string deprecation)${var}→{$var}string interpolation in testsReflectionProperty::setAccessible()behindPHP_VERSION_ID < 80100(still required on 7.4; no-op + deprecated on 8.5)CI — matrix now covers PHP 7.4, 8.0, 8.1, 8.2, 8.3, 8.4, 8.5.
Notes
^3.0.--prefer-lowestruns on PHP 7.4 only. The library's lowest declared runtime deps (doctrine/dbal ^2.5,symfony/console ^5) predate PHP 8, so lowest-deps resolution isn't PHP-8-safe. If we'd rather the floor itself be PHP-8-installable, we can raisedoctrine/dbalto^2.13(still supports 7.4) and run--prefer-lowestacross the whole matrix.Testing
Locally on PHP 8.5:
phpcsclean,phpunitpasses (727 tests, 856 assertions), zero deprecations.🤖 Generated with Claude Code