Skip to content

Commit 376cb25

Browse files
SpacePossumsebastianbergmann
authored andcommitted
Fix zero range.
1 parent 347c1d8 commit 376cb25

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Output/UnifiedDiffOutputBuilder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,12 +114,12 @@ private function writeChunk(
114114
if ($this->addLineNumbers) {
115115
\fwrite($output, '@@ -' . (1 + $fromStart));
116116

117-
if ($fromRange > 1) {
117+
if ($fromRange !== 1) {
118118
\fwrite($output, ',' . $fromRange);
119119
}
120120

121121
\fwrite($output, ' +' . (1 + $toStart));
122-
if ($toRange > 1) {
122+
if ($toRange !== 1) {
123123
\fwrite($output, ',' . $toRange);
124124
}
125125

tests/DifferTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -748,7 +748,7 @@ public function provideDiffWithLineNumbers(): array
748748
'II non_patch_compat' => [
749749
'--- Original
750750
+++ New
751-
@@ -1,2 +1 @@
751+
@@ -1,2 +1,0 @@
752752
-
753753
-
754754
'

0 commit comments

Comments
 (0)