Upgrade to PHP 7.4 and migrate CI to GitHub Actions#19
Merged
Conversation
There was a problem hiding this comment.
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.distand testsetUp()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.
ff79432 to
e26e327
Compare
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>
e26e327 to
c0584a1
Compare
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
Upgrades the project to PHP 7.4 (drops 5.6 / 7.0–7.3 support) and migrates CI from Travis to GitHub Actions.
Changes
composer.jsonphp:^5.6 | ^7.0→^7.4;platform.php7.2 → 7.4composer.jsonsymfony/console:^2.8 | ^3.2 | ^4.0 | ^5.0→^3.4 | ^4.0 | ^5.0composer.jsonphpunit/phpunit:^5.7.21 | ^6 | ^7→^9.3composer.jsonsquizlabs/php_codesniffer:^3→^4.0composer.jsongraze/standards:^2.0→^3.0composer.jsonmockery/mockeryfloor:^1→^1.3MockeryPHPUnitIntegrationtrait lacks: voidreturn types;--prefer-lowestwould otherwise pick a Mockery incompatible with PHPUnit 8+composer.lockphpunit.xml.dist<filter><whitelist>→<coverage><include>via--migrate-configurationtests/unit/*(4 files): voidtosetUp()TestCasesignatureMakefile,docker-compose.ymlgraze/php-alpine:7.4-test.gitignore/.phpunit.result.cache.travis.yml→.github/workflows/ci.yml{highest, lowest}matrix runsphpcsandphpunit.github/workflows/ci.yml,README.mdpcov/--coverage-cloverflagswget ocular.phar && php ocular.phar …flow was an unverified PHAR download; Scrutinizer is also largely defunctREADME.mdstyle=flat-square; asciicast embed removedVerification
Verified locally in
graze/php-alpine:7.4-testand in CI under bothhighestand--prefer-lowestcomposer resolutions:phpcsclean, 112 PHPUnit tests pass under both.🤖 Generated with Claude Code