Skip to content

Commit d1c05fd

Browse files
authored
Avoid unintentional conversion of index to boolean (#208)
Avoid unintentional conversion of index to boolean.
1 parent 5fa8b85 commit d1c05fd

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
@@ -92,8 +92,8 @@ protected function doParse()
9292
$oldName = $oldName === '/dev/null' ? null : substr($oldName, 2);
9393
$newName = $newName === '/dev/null' ? null : substr($newName, 2);
9494

95-
$oldIndex = $oldIndex !== null ?: '';
96-
$newIndex = $newIndex !== null ?: '';
95+
$oldIndex = $oldIndex === null ? '' : $oldIndex;
96+
$newIndex = $newIndex === null ? '' : $newIndex;
9797
$oldIndex = preg_match('/^0+$/', $oldIndex) ? null : $oldIndex;
9898
$newIndex = preg_match('/^0+$/', $newIndex) ? null : $newIndex;
9999
$file = new File($oldName, $newName, $oldMode, $newMode, $oldIndex, $newIndex, $isBinary);

0 commit comments

Comments
 (0)