properly handle empty lines
This commit is contained in:
parent
ca1d4b4a93
commit
e91bb614ae
@ -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];
|
||||
}
|
||||
|
Reference in New Issue
Block a user