Skip to content

Commit 3b32f1c

Browse files
committed
Do not say that an error is fixable if the old code is same as new code
1 parent e10458b commit 3b32f1c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Analyser/RuleErrorTransformer.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,9 @@ public function transform(
133133
$printer = new PhpPrinter(['indent' => str_repeat($indentDetector->indentCharacter, $indentDetector->indentSize)]);
134134
$newCode = $printer->printFormatPreserving($newStmts, $fileNodes, $oldTokens);
135135

136-
$fixedErrorDiff = new FixedErrorDiff($hash, $this->differ->diff($oldCode, $newCode));
136+
if ($oldCode !== $newCode) {
137+
$fixedErrorDiff = new FixedErrorDiff($hash, $this->differ->diff($oldCode, $newCode));
138+
}
137139
}
138140

139141
return new Error(

0 commit comments

Comments
 (0)