Skip to content

[BUGFIX] Replace usage of UnifiedDiffOutputBuilder with StrictUnifiedDiffOutputBuilder#409

Draft
alexanderschnitzler wants to merge 1 commit into
andreaswolf:mainfrom
alexanderschnitzler:fix/diff-output-builder
Draft

[BUGFIX] Replace usage of UnifiedDiffOutputBuilder with StrictUnifiedDiffOutputBuilder#409
alexanderschnitzler wants to merge 1 commit into
andreaswolf:mainfrom
alexanderschnitzler:fix/diff-output-builder

Conversation

@alexanderschnitzler

Copy link
Copy Markdown
Contributor

Resolves: #408

@alexanderschnitzler

Copy link
Copy Markdown
Contributor Author

@andreaswolf @simonschaufi Maybe someone of you can take a deeper look sometime. I am not quite sure how fractor works in detail.

It seems that replacing the UnifiedDiffOutputBuilder with the StrictUnifiedDiffOutputBuilder is not the actual solution here as you strip the headers of unified diffs. I tried using the DiffOnlyOutputBuilder and without removing the first line of the diff, this works well actually. But the e2e-tests are something different to have a look at then.

@alexanderschnitzler alexanderschnitzler marked this pull request as draft June 18, 2026 10:14
@simonschaufi

Copy link
Copy Markdown
Collaborator

What I would do is to check how Rector fixed this issue as most of the Fractor code is almost a 1:1 copy of Rector

private ColorConsoleDiffFormatter $colorConsoleDiffFormatter
) {
$unifiedDiffOutputBuilder = new UnifiedDiffOutputBuilder();
$unifiedDiffOutputBuilder = new StrictUnifiedDiffOutputBuilder([

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Have a look at the DefaultDiffer from Rector (in the rector-src repo)

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.

[BUG] UnifiedDiffOutputBuilder Class not found with sebastian/diff:9.0

2 participants