Skip to content

Commit

Permalink
Fix the bug for counter variable type on PR #183
Browse files Browse the repository at this point in the history
  • Loading branch information
peter279k committed Dec 9, 2020
1 parent d1fe467 commit 6da60b3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Gitonomy/Git/Parser/DiffParser.php
Expand Up @@ -97,10 +97,10 @@ protected function doParse()
// 5. Diff
while ($this->expects('@@ ')) {
$vars = $this->consumeRegexp('/-(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))?/');
$rangeOldStart = $vars[1];
$rangeOldCount = $vars[2];
$rangeNewStart = $vars[3];
$rangeNewCount = isset($vars[4]) ? $vars[4] : $vars[2]; // @todo Ici, t'as pris un gros raccourci mon loulou
$rangeOldStart = (int) $vars[1];
$rangeOldCount = (int) $vars[2];
$rangeNewStart = (int) $vars[3];
$rangeNewCount = isset($vars[4]) ? (int) $vars[4] : (int) $vars[2]; // @todo Ici, t'as pris un gros raccourci mon loulou
$this->consume(' @@');
$this->consumeTo("\n");
$this->consumeNewLine();
Expand Down

0 comments on commit 6da60b3

Please sign in to comment.