Repository navigation
Drop support of sebastian/diff below 5.1 - #88
Merged
Merged
Conversation
PatchParser now uses only the sebastian/diff API that 5.1 to 9 share: to(), chunks(), end(), lines(), type() and content(). The method_exists() fallbacks for the old API and their PHPStan ignore are removed. CI never installed sebastian/diff below 5.1, because PHPUnit 10.5 needs 5.1.1. So the fallbacks were never tested. With an older version, --patch now stops with a clear error instead of a fatal error. The other commands do not use sebastian/diff and still work. Co-Authored-By: Claude Code
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.
PatchParsercalled the oldsebastian/diffAPI (getTo(),getChunks(), …) when the new API did not exist. Onlysebastian/diff4 and 5.0 need this, and PHPUnit 9 installs 4.Changes
PatchParseruses only the API thatsebastian/diff5.1 to 9 share:to(),chunks(),end(),lines(),type(),content(). Themethod_exists()fallbacks and their PHPStan ignore are removed.^5.1.1 || ^6.0 || ^7.0. CI never installed a version below 5.1, because PHPUnit 10.5 needs 5.1.1, so the fallbacks were never tested.--patchstops withyou need sebastian/diff 5.1 or newer, 4.0.6 is installedinstead of a fatal error. The other commands do not usesebastian/diff, so they still work with PHPUnit 9.sebastian/diff5.1+.Relation to #87
#87 keeps the fallbacks and adds a path ignore for
PatchParserwithreportUnmatched: false, becausesebastian/diff6.0+ removed the old API. When #87 is merged, this PR gets a rebase that also removes that ignore. The PRs do not depend on each other, so they can merge in any order.Testing
composer checkpasses.sebastian/diff4.0.6:--patchshows the new error message.Co-Authored-By: Claude Code