minor #36689 [Yaml] properly handle empty lines (xabbuh)
This PR was merged into the 5.1-dev branch.
Discussion
----------
[Yaml] properly handle empty lines
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets |
| License | MIT
| Doc PR |
Commits
-------
e91bb614ae
properly handle empty lines
This commit is contained in:
commit
6852327eee
@ -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