Skip to content

Commit 1fc3b02

Browse files
committed
Apply @xabbuh's suggestion
1 parent 1e092fc commit 1fc3b02

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/Symfony/Component/Yaml/Parser.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1206,11 +1206,8 @@ private function lexInlineStructure(int &$cursor, string $closingTag, bool $cons
12061206
$value .= $this->currentLine[$cursor];
12071207
++$cursor;
12081208

1209-
if ($consumeUntilEol && isset($this->currentLine[$cursor]) && (strspn($this->currentLine, ' ', $cursor) + $cursor) < strlen($this->currentLine)) {
1210-
$remain = trim(substr($this->currentLine, $cursor));
1211-
if (!str_starts_with($remain, '#')) {
1212-
throw new ParseException(sprintf('Unexpected token "%s".', $remain));
1213-
}
1209+
if ($consumeUntilEol && isset($this->currentLine[$cursor]) && ($whitespaces = strspn($this->currentLine, ' ', $cursor) + $cursor) < strlen($this->currentLine) && '#' !== $this->currentLine[$whitespaces]) {
1210+
throw new ParseException(sprintf('Unexpected token "%s".', trim(substr($this->currentLine, $cursor))));
12141211
}
12151212

12161213
return $value;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy