Skip to content

Commit 793ffe5

Browse files
authored
Assign to variable to prevent null value (#192)
1 parent 3c2f67a commit 793ffe5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Gitonomy/Git/Parser/DiffParser.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ protected function doParse()
9090

9191
$oldName = $oldName === '/dev/null' ? null : substr($oldName, 2);
9292
$newName = $newName === '/dev/null' ? null : substr($newName, 2);
93-
$oldIndex !== null ?: '';
94-
$newIndex !== null ?: '';
93+
$oldIndex = $oldIndex !== null ?: '';
94+
$newIndex = $newIndex !== null ?: '';
9595
$oldIndex = preg_match('/^0+$/', $oldIndex) ? null : $oldIndex;
9696
$newIndex = preg_match('/^0+$/', $newIndex) ? null : $newIndex;
9797
$file = new File($oldName, $newName, $oldMode, $newMode, $oldIndex, $newIndex, $isBinary);

0 commit comments

Comments
 (0)