Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 3d9c634

Browse filesBrowse files
committed
[Yaml] Fix sequence with following mapping
1 parent ecf9859 commit 3d9c634
Copy full SHA for 3d9c634

File tree

2 files changed

+17
-1
lines changed
Filter options

2 files changed

+17
-1
lines changed

‎src/Symfony/Component/Yaml/Parser.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Yaml/Parser.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1242,7 +1242,7 @@ private function lexInlineSequence(string $yaml): string
12421242
$value = $yaml;
12431243

12441244
while ($this->moveToNextLine()) {
1245-
for ($i = 1; isset($this->currentLine[$i]) && ']' !== $this->currentLine[$i]; ++$i) {
1245+
for ($i = 0; isset($this->currentLine[$i]) && ']' !== $this->currentLine[$i]; ++$i) {
12461246
}
12471247

12481248
$trimmedValue = trim($this->currentLine);

‎src/Symfony/Component/Yaml/Tests/ParserTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Yaml/Tests/ParserTest.php
+16Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1699,6 +1699,22 @@ public function inlineNotationSpanningMultipleLinesProvider(): array
16991699
YAML
17001700
,
17011701
],
1702+
'sequence spanning multiple lines nested in mapping with a following mapping' => [
1703+
[
1704+
'foobar' => [
1705+
'foo',
1706+
'bar',
1707+
],
1708+
'bar' => 'baz'
1709+
],
1710+
<<<YAML
1711+
foobar: [
1712+
foo,
1713+
bar,
1714+
]
1715+
bar: baz
1716+
YAML
1717+
],
17021718
'nested sequence nested in mapping starting on the same line' => [
17031719
[
17041720
'foo' => [

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.