Skip to content

Drop PHP 7.2/7.3 support, bump symfony to ^5#71

Merged
rick-lam merged 3 commits into
masterfrom
chore/drop-php-7.2-7.3
May 27, 2026
Merged

Drop PHP 7.2/7.3 support, bump symfony to ^5#71
rick-lam merged 3 commits into
masterfrom
chore/drop-php-7.2-7.3

Conversation

@rick-lam
Copy link
Copy Markdown
Collaborator

Summary

  • Raises required PHP to ^7.4 and bumps symfony/console + symfony/yaml to ^5 so composer resolution succeeds under its new block-insecure default (advisories PKSA-v5yj-8nmz-sk2q, PKSA-ft77-7h5f-p3r6, PKSA-b14r-zh1d-vdrc cover all of symfony/yaml v2/v3/v4).
  • Trims the CI matrix to PHP 7.4 and shrinks Makefile's test-matrix accordingly.
  • Tightens TokenStream::rewind to \stdClass $mark and switches the $spec docblocks to string|array so the upgraded php_codesniffer (3.13.5) accepts the source.
  • For the remaining mixed params in test data providers (genuinely heterogeneous — string|int|null, string|array — and no PHP 7.4 type expresses that), excludes Squiz.Commenting.FunctionComment.TypeHintMissing under */tests/* in phpcs.xml.

Master's CI has been red since the symfony/yaml advisories landed; this also unblocks #70.

Test plan

  • CI matrix (PHP 7.4, both prefer-lowest variants) goes green.
  • make test locally on PHP 7.4 — phpunit reports Tests: 727, Assertions: 856, Warnings: 91 (warnings are pre-existing @expectedException deprecations).
  • Functional tests still pass (make test-functional).
  • Confirm no downstream consumers depend on Morphism\Parse\TokenStream::rewind accepting non-stdClass arguments.

🤖 Generated with Claude Code

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>
Copilot AI review requested due to automatic review settings May 26, 2026 18:11
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>
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 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.4 and bump symfony/console + symfony/yaml to ^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.

Comment thread src/Parse/TokenStream.php
Comment thread composer.json
- 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>
@rick-lam rick-lam merged commit 26e639c into master May 27, 2026
4 checks passed
@rick-lam rick-lam deleted the chore/drop-php-7.2-7.3 branch May 27, 2026 08:18
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