Skip to content

Support PHP 7.4–8.5 and upgrade dev tooling#73

Merged
rick-lam merged 2 commits into
masterfrom
chore/php-7.4-8.5-tooling-upgrade
May 28, 2026
Merged

Support PHP 7.4–8.5 and upgrade dev tooling#73
rick-lam merged 2 commits into
masterfrom
chore/php-7.4-8.5-tooling-upgrade

Conversation

@rick-lam
Copy link
Copy Markdown
Collaborator

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.json

  • php: ^7.4^7.4 || ^8.0
  • phpunit/phpunit: ^8^9
  • squizlabs/php_codesniffer: ^3.5.0^4.0
  • graze/standards: ^2.0^3.0
  • mockery/mockery: ^1.2^1.6
  • symfony/var-dumper (dev): ^4.2^4.2 || ^5.0

Tests — PHPUnit 9 API migration (removed APIs the suite relied on)

  • @expectedException annotations → $this->expectException(...)
  • assertRegExpassertMatchesRegularExpression
  • assertInternalType('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(): cast strcasecmp() args to string (null-to-string deprecation)
  • ${var}{$var} string interpolation in tests
  • Guarded ReflectionProperty::setAccessible() behind PHP_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

  • graze/standards: there is no v4 release on Packagist (latest is v3.0.0, itself built against PHP_CodeSniffer ^4), so this uses ^3.0.
  • --prefer-lowest runs 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 raise doctrine/dbal to ^2.13 (still supports 7.4) and run --prefer-lowest across the whole matrix.

Testing

Locally on PHP 8.5: phpcs clean, phpunit passes (727 tests, 856 assertions), zero deprecations.

🤖 Generated with Claude Code

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>
Copilot AI review requested due to automatic review settings May 28, 2026 20:51
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 12 out of 13 changed files in this pull request and generated no new comments.

@rick-lam rick-lam merged commit 0472c61 into master May 28, 2026
11 checks 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