We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 18a6677 commit 8bc3354Copy full SHA for 8bc3354
src/Issue/Issue.php
@@ -78,7 +78,8 @@ public function getErroredLine()
78
{
79
if (null === $this->erroredLine) {
80
$lines = explode(PHP_EOL, $this->node->getValue());
81
- $this->erroredLine = $lines[$this->localLine - 1];
+ // We do -1 because the $lines array is zero-index and the error message is 1-index
82
+ $this->erroredLine = $lines[max(0, $this->localLine - 1)];
83
}
84
85
return $this->erroredLine;
0 commit comments