Skip to content

Commit

Permalink
Assign to variable to prevent null value (#192)
Browse files Browse the repository at this point in the history
  • Loading branch information
phpfui authored Mar 1, 2022
1 parent 3c2f67a commit 793ffe5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Gitonomy/Git/Parser/DiffParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ protected function doParse()

$oldName = $oldName === '/dev/null' ? null : substr($oldName, 2);
$newName = $newName === '/dev/null' ? null : substr($newName, 2);
$oldIndex !== null ?: '';
$newIndex !== null ?: '';
$oldIndex = $oldIndex !== null ?: '';
$newIndex = $newIndex !== null ?: '';
$oldIndex = preg_match('/^0+$/', $oldIndex) ? null : $oldIndex;
$newIndex = preg_match('/^0+$/', $newIndex) ? null : $newIndex;
$file = new File($oldName, $newName, $oldMode, $newMode, $oldIndex, $newIndex, $isBinary);
Expand Down

0 comments on commit 793ffe5

Please sign in to comment.