Skip to content

Upgrade to PHP 7.4 and migrate CI to GitHub Actions#19

Merged
rick-lam merged 1 commit into
masterfrom
upgrade/php-7.4-and-github-actions
May 28, 2026
Merged

Upgrade to PHP 7.4 and migrate CI to GitHub Actions#19
rick-lam merged 1 commit into
masterfrom
upgrade/php-7.4-and-github-actions

Conversation

@rick-lam
Copy link
Copy Markdown
Contributor

@rick-lam rick-lam commented May 28, 2026

Summary

Upgrades the project to PHP 7.4 (drops 5.6 / 7.0–7.3 support) and migrates CI from Travis to GitHub Actions.

Changes

File(s) Change Why
composer.json php: ^5.6 | ^7.0^7.4; platform.php 7.2 → 7.4 Adopt PHP 7.4 as the project target
composer.json symfony/console: ^2.8 | ^3.2 | ^4.0 | ^5.0^3.4 | ^4.0 | ^5.0 Drop EOL Symfony 2.x / pre-LTS 3.x that pre-date 7.4
composer.json phpunit/phpunit: ^5.7.21 | ^6 | ^7^9.3 Highest PHPUnit line that still supports PHP 7.4
composer.json squizlabs/php_codesniffer: ^3^4.0 Move to PHPCS 4
composer.json graze/standards: ^2.0^3.0 PHPCS 4 support
composer.json mockery/mockery floor: ^1^1.3 Mockery <1.3's MockeryPHPUnitIntegration trait lacks : void return types; --prefer-lowest would otherwise pick a Mockery incompatible with PHPUnit 8+
composer.lock Regenerated against the 7.4 platform Pick up all the new constraints
phpunit.xml.dist Migrated <filter><whitelist><coverage><include> via --migrate-configuration PHPUnit 9.3+ schema
tests/unit/* (4 files) Added : void to setUp() Required by PHPUnit 8+'s tightened TestCase signature
Makefile, docker-compose.yml PHP version pinned to 7.4 / image to graze/php-alpine:7.4-test Match the new platform
.gitignore Ignore /.phpunit.result.cache New artifact under PHPUnit 9
.travis.yml.github/workflows/ci.yml Replaced Travis with a GHA workflow: PHP 7.4 × {highest, lowest} matrix runs phpcs and phpunit Travis CI is no longer in use; move CI to GitHub Actions where the rest of the org runs
.github/workflows/ci.yml, README.md Dropped Scrutinizer-CI integration: removed the upload step, both Scrutinizer badges, and the now-unused pcov / --coverage-clover flags The old wget ocular.phar && php ocular.phar … flow was an unverified PHAR download; Scrutinizer is also largely defunct
README.md Build badge → shields.io GHA badge with style=flat-square; asciicast embed removed Match the other badges; tidy-up

Verification

Verified locally in graze/php-alpine:7.4-test and in CI under both highest and --prefer-lowest composer resolutions: phpcs clean, 112 PHPUnit tests pass under both.

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings May 28, 2026 09:22
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 modernizes the project by standardizing on PHP 7.4 (including updating PHPUnit configuration/tests and dependency constraints) and replacing the legacy Travis CI pipeline with a GitHub Actions workflow.

Changes:

  • Upgraded PHP requirements and dev tooling to PHP 7.4 + PHPUnit 9, including updated phpunit.xml.dist and test setUp() signatures.
  • Migrated CI from Travis to GitHub Actions with a highest/lowest dependency matrix and Scrutinizer coverage upload.
  • Updated local/dev tooling configuration (Makefile, docker-compose image pin, gitignore, README badge) to align with the new baseline.

Reviewed changes

Copilot reviewed 11 out of 13 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
composer.json Raises PHP requirement to ^7.4 and adjusts Symfony Console + PHPUnit constraints.
composer.lock Regenerated lockfile for the PHP 7.4 / PHPUnit 9 dependency set.
phpunit.xml.dist Migrates coverage configuration to PHPUnit 9 schema.
tests/unit/Wrap/WrapperTest.php Updates setUp() signature for PHPUnit 8+.
tests/unit/Terminal/ANSITest.php Updates setUp() signature for PHPUnit 8+.
tests/unit/DiffConsoleOutputTest.php Updates setUp() signature for PHPUnit 8+.
tests/unit/DiffConsoleOutputPassthroughTest.php Updates setUp() signature for PHPUnit 8+.
Makefile Sets PHP version to 7.4 and simplifies the test matrix target.
docker-compose.yml Pins test container image to graze/php-alpine:7.4-test.
.gitignore Ignores PHPUnit 9 result cache artifact.
.travis.yml Removes legacy Travis CI configuration.
.github/workflows/ci.yml Adds GitHub Actions CI workflow (PHP 7.4, highest/lowest deps, phpcs, phpunit, coverage upload).
README.md Switches build badge from Travis to GitHub Actions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/ci.yml Outdated
Comment thread .github/workflows/ci.yml Outdated
Comment thread README.md Outdated
@rick-lam rick-lam force-pushed the upgrade/php-7.4-and-github-actions branch 3 times, most recently from ff79432 to e26e327 Compare May 28, 2026 10:24
PHP 7.4 upgrade
- composer.json: platform.php 7.2 -> 7.4; require.php ^5.6|^7.0 ->
  ^7.4; narrow symfony/console to ^3.4|^4.0|^5.0 (drop EOL 2.8 /
  pre-LTS 3.x that predate 7.4); bump phpunit/phpunit to ^9.3
  (highest version that still supports 7.4); bump
  squizlabs/php_codesniffer to ^4.0; bump graze/standards to ^3.0
  (PHPCS 4 support, BC break in that repo); raise mockery/mockery
  floor to ^1.3 so `--prefer-lowest` resolves to a Mockery release
  whose `MockeryPHPUnitIntegration` trait declares `: void` return
  types compatible with PHPUnit 8+.
- composer.lock regenerated against the 7.4 platform.
- phpunit.xml.dist migrated to the PHPUnit 9.3+ schema
  (<filter><whitelist> -> <coverage><include>).
- Added `: void` return type to setUp() in 4 tests (required by
  PHPUnit 8+).
- Makefile: PHP_VER 7.2 -> 7.4; test-matrix reduced to 7.4.
- docker-compose.yml: image pinned to graze/php-alpine:7.4-test.
- .gitignore: ignore /.phpunit.result.cache (new under PHPUnit 9).

Travis -> GitHub Actions
- Removed .travis.yml.
- Added .github/workflows/ci.yml. Triggers on push to master and on
  PRs. Matrix: PHP 7.4 x {highest, lowest} composer resolutions
  (preserves the --prefer-lowest coverage Travis had). Uses
  shivammathur/setup-php and ramsey/composer-install (v4). Runs
  phpcs and phpunit.
- README.md: replaced Travis build badge with a shields.io GitHub
  Actions badge using style=flat-square to match the other badges.

Dropped Scrutinizer-CI integration
- Removed the workflow step that downloaded `ocular.phar` and
  uploaded clover coverage (addresses the supply-chain concern
  about fetching and executing an unverified PHAR).
- Removed `coverage: pcov` from setup-php and the
  `--coverage-clover=...` flag from phpunit, since nothing now
  consumes the report in CI. The Makefile's local `test-coverage*`
  targets are unchanged.
- README.md: removed the Scrutinizer "Coverage Status" and
  "Quality Score" badges.

Verified locally in graze/php-alpine:7.4-test against both
`highest` and `lowest --prefer-lowest` composer resolutions:
phpcs clean, 112 PHPUnit tests pass under both.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@rick-lam rick-lam force-pushed the upgrade/php-7.4-and-github-actions branch from e26e327 to c0584a1 Compare May 28, 2026 10:25
@rick-lam rick-lam requested a review from Copilot May 28, 2026 10:33
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 11 out of 13 changed files in this pull request and generated no new comments.

@rick-lam rick-lam merged commit 18b296e into master May 28, 2026
3 checks passed
@rick-lam rick-lam deleted the upgrade/php-7.4-and-github-actions branch May 28, 2026 17:59
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