Drop PHP 7.2/7.3 support, bump symfony to ^5#71
Merged
Conversation
CI has been failing because Packagist now blocks symfony/yaml v2/v3/v4 under composer's `block-insecure` default (advisories PKSA-v5yj-8nmz-sk2q, PKSA-ft77-7h5f-p3r6, PKSA-b14r-zh1d-vdrc). Raises the floor to PHP 7.4 and symfony/console + symfony/yaml ^5, trims the CI matrix and Makefile test-matrix to 7.4, and tightens TokenStream typing (`\stdClass` for $mark, docblock `string|array` for $spec) so the upgraded php_codesniffer accepts the diff. The remaining `mixed` cases live in test data providers where PHP 7.4 has no equivalent type, so Squiz.Commenting.FunctionComment.TypeHintMissing is excluded for `*/tests/*` in phpcs.xml. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
symfony/console v5 enforces the return-type that v4 only deprecated: omitting `return` from `Command::execute()` now throws a TypeError at runtime. Adds `: int` declarations and explicit `return 0;` at the end of Diff, Extract, and Fastdump. Lint already returned an int count of error files — only its signature needed the return type. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR updates Morphism’s supported/runtime baseline to PHP 7.4 and modernizes key dependencies (notably Symfony) to restore Composer installability under current security/advisory behavior, while aligning CI and linting to the new baseline.
Changes:
- Raise required PHP version to
^7.4and bumpsymfony/console+symfony/yamlto^5(with corresponding lockfile updates). - Reduce CI and Makefile test matrices to PHP 7.4 only.
- Update parsing/linting-related typing and PHPCS configuration to satisfy the newer PHPCS ruleset.
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
src/Parse/TokenStream.php |
Tightens rewind() parameter typing and updates $spec param docblocks for PHPCS compatibility. |
phpcs.xml |
Excludes TypeHintMissing sniff for tests to accommodate mixed-type data providers on PHP 7.4. |
Makefile |
Removes legacy PHP versions from test-matrix, leaving only PHP 7.4. |
composer.json |
Bumps minimum PHP and Symfony component requirements. |
composer.lock |
Updates resolved dependency set to match the new PHP/Symfony requirements. |
.github/workflows/ci.yml |
Shrinks CI matrix to PHP 7.4 only (still tests prefer-lowest and default). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- TokenStream::rewind() now accepts `object` rather than `\stdClass`, matching the original untyped contract for any caller passing a plain object. getMark()'s PHPDoc is tightened to `\stdClass` so the producer side still documents the concrete shape. - require-dev pins phpunit/phpunit to `^8`; the wider `^5.7.21 | ^6 | ^7 | ^8` range can no longer resolve because DBAL pulls doctrine/deprecations which conflicts with phpunit <=7.5. Co-Authored-By: Claude Opus 4.7 (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
^7.4and bumpssymfony/console+symfony/yamlto^5so composer resolution succeeds under its newblock-insecuredefault (advisoriesPKSA-v5yj-8nmz-sk2q,PKSA-ft77-7h5f-p3r6,PKSA-b14r-zh1d-vdrccover all of symfony/yaml v2/v3/v4).Makefile'stest-matrixaccordingly.TokenStream::rewindto\stdClass $markand switches the$specdocblocks tostring|arrayso the upgradedphp_codesniffer(3.13.5) accepts the source.mixedparams in test data providers (genuinely heterogeneous —string|int|null,string|array— and no PHP 7.4 type expresses that), excludesSquiz.Commenting.FunctionComment.TypeHintMissingunder*/tests/*inphpcs.xml.Master's CI has been red since the symfony/yaml advisories landed; this also unblocks #70.
Test plan
make testlocally on PHP 7.4 — phpunit reportsTests: 727, Assertions: 856, Warnings: 91(warnings are pre-existing@expectedExceptiondeprecations).make test-functional).Morphism\Parse\TokenStream::rewindaccepting non-stdClass arguments.🤖 Generated with Claude Code