properly handle empty lines

This commit is contained in:
Christian Flothmann 2020-05-04 18:35:27 +02:00
parent ca1d4b4a93
commit e91bb614ae
1 changed files with 1 additions and 1 deletions

View File

@ -969,7 +969,7 @@ class Parser
private function isCurrentLineComment(): bool
{
//checking explicitly the first char of the trim is faster than loops or strpos
$ltrimmedLine = ' ' === $this->currentLine[0] ? ltrim($this->currentLine, ' ') : $this->currentLine;
$ltrimmedLine = '' !== $this->currentLine && ' ' === $this->currentLine[0] ? ltrim($this->currentLine, ' ') : $this->currentLine;
return '' !== $ltrimmedLine && '#' === $ltrimmedLine[0];
}