Skip to content

Require sebastian/diff 9 - #94

Merged
ruudk merged 2 commits into
ruudk:mainfrom
Orest-Divintari:require-sebastian-diff-9
Aug 4, 2026
Merged

Require sebastian/diff 9#94
ruudk merged 2 commits into
ruudk:mainfrom
Orest-Divintari:require-sebastian-diff-9

Conversation

@Orest-Divintari

@Orest-Divintari Orest-Divintari commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Raises the minimum for sebastian/diff to ^9.0.

Dropping 7 and 8 means the code no longer has to work across three major versions of the diff API. Concretely, StrictUnifiedDiffOutputBuilder can take the header verbatim through the header option, which only exists from 8.3 on; #93 had to reconstruct the same string through fromFile/toFile to stay compatible with the older range. I have left that call as it is here, so this PR is only the constraint change — happy to simplify it in a follow-up if you would like.

The dev floors have to move too

CI resolves lowest as well as highest, and on the lowest leg the old dev floors are unsatisfiable against a root requirement of ^9.0:

package floor before floor now why
phpunit/phpunit ^13.1.7 ^13.2 13.1.14 requires sebastian/diff ^8.3.0; 13.2.0 is the first to require ^9.0
friendsofphp/php-cs-fixer ^3.95.1 ^3.95.18 3.95.1 allows ^4.0.6 || … || ^8.0; 3.95.18 is the first to add ^9.0

Verified: composer update --prefer-lowest --dry-run now resolves, taking PHPUnit down to exactly 13.2.0 with sebastian/diff staying at 9.

One knock-on change

PHPUnit 13.2 soft-deprecates expectExceptionMessage(), and phpstan-deprecation-rules reports it, so the two call sites in tests/ move to expectExceptionMessageIsOrContains(). Without that, phpstan analyse fails as soon as the floor allows 13.2. Kept as its own commit.

Verified

  • vendor/bin/phpunit — 185 tests, 667 assertions, OK
  • vendor/bin/php-cs-fixer check — clean, 0 of 211 files need fixing
  • vendor/bin/phpstan analyse — no errors
  • composer update --prefer-lowest --dry-run — resolves, no conflict

PHPUnit 13.2 soft-deprecates expectExceptionMessage() in favour of the
longer name, which says that the message is matched as equal-or-substring
rather than leaving it ambiguous. phpstan-deprecation-rules reports the two
call sites as soon as the floor allows 13.2.
Dropping 7 and 8 means the code no longer has to work across three major
versions of the diff API, and StrictUnifiedDiffOutputBuilder can use the
header option directly, which only exists from 8.3 on.

The dev floors move with it, because CI resolves lowest as well as highest:
PHPUnit requires diff 9 from 13.2.0, and PHP CS Fixer allows it from
3.95.18, so leaving either floor lower makes the lowest job unresolvable.

@ruudk ruudk left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Thanks!

@ruudk
ruudk merged commit 1a627e3 into ruudk:main Aug 4, 2026
3 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