Skip to content

Commit

Permalink
Fix bug which caused false to be appended to code trace if it termina…
Browse files Browse the repository at this point in the history
…ted less than 5 lines before the end of the file.
  • Loading branch information
Austin Kregel committed Aug 29, 2018
1 parent 29cb8c3 commit dc20550
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Stacktrace.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,10 @@ protected function getTheCodeFromTheFile($file, $lineNumber, $currentLine = 0):

$line = fgets($handle);

if ($line === false) {
break;
}

if (($currentLine - $lineNumber) > -static::NUMBER_OF_LINES_TO_DISPLAY && ($currentLine - $lineNumber) < static::NUMBER_OF_LINES_TO_DISPLAY) {
$linesOfCode[$currentLine] = $line;
}
Expand Down

0 comments on commit dc20550

Please sign in to comment.