Skip to content

Commit

Permalink
Merge branch '6.4' into 7.1
Browse files Browse the repository at this point in the history
* 6.4:
  Remove comment about AppVeyor in `phpunit`
  [Webhook][RemoteEvent] fix SendgridPayloadConverter category support
  Update old Appveyor skip conditions
  sync the Dutch translation file with changes from the 7.2 branch
  [Yaml] fix inline notation with inline comment
  fix(property-info): make sure that SerializerExtractor returns null for invalid class metadata
  [RemoteEvent][Webhook] fix SendgridRequestParser & SendgridPayloadConverter in case of missing sg_message_id
  fix_50486 - memory leak
  • Loading branch information
xabbuh committed Jan 7, 2025
2 parents ff52a85 + bf598c9 commit 4921b8c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -1201,7 +1201,7 @@ private function lexInlineStructure(int &$cursor, string $closingTag, bool $cons
$value .= $this->currentLine[$cursor];
++$cursor;

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

Expand Down
13 changes: 13 additions & 0 deletions Tests/ParserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2158,6 +2158,19 @@ public static function inlineNotationSpanningMultipleLinesProvider(): array
<<<YAML
map: {key: "value", a: "b"}
param: "some"
YAML
],
'mixed mapping with inline notation on one line with a comment' => [
[
'map' => [
'key' => 'value',
'a' => 'b',
],
'param' => 'some',
],
<<<YAML
map: {key: "value", a: "b"} # comment
param: "some"
YAML
],
'mixed mapping with compact inline notation on one line' => [
Expand Down

0 comments on commit 4921b8c

Please sign in to comment.