Skip to content

Commit ac238f1

Browse files
committed
Merge branch '7.1' into 7.2
* 7.1: 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
2 parents 9db31f0 + 4921b8c commit ac238f1

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

Parser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1213,7 +1213,7 @@ private function lexInlineStructure(int &$cursor, string $closingTag, bool $cons
12131213
$value .= $this->currentLine[$cursor];
12141214
++$cursor;
12151215

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

Tests/ParserTest.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2178,6 +2178,19 @@ public static function inlineNotationSpanningMultipleLinesProvider(): array
21782178
<<<YAML
21792179
map: {key: "value", a: "b"}
21802180
param: "some"
2181+
YAML
2182+
],
2183+
'mixed mapping with inline notation on one line with a comment' => [
2184+
[
2185+
'map' => [
2186+
'key' => 'value',
2187+
'a' => 'b',
2188+
],
2189+
'param' => 'some',
2190+
],
2191+
<<<YAML
2192+
map: {key: "value", a: "b"} # comment
2193+
param: "some"
21812194
YAML
21822195
],
21832196
'mixed mapping with compact inline notation on one line' => [

0 commit comments

Comments
 (0)