Skip to content

Commit

Permalink
Merge branch '7.0' into 7.1
Browse files Browse the repository at this point in the history
* 7.0: (22 commits)
  fix merge
  [AssetMapper] Check asset/vendor directory is writable
  detect wrong e-mail validation modes
  detect wrong usages of minMessage/maxMessage in options
  [Security] Remove workflow from empty folder
  read form values using the chain data accessor
  [Validator] Review Bulgarian (bg) translation
  Reviewed italian translation
  Fix french translation
  call substr() with integer offsets
  [Finder] Also consider .git inside the basedir of in() directory
  review: FR translation
  [Serializer] Add AbstractNormalizerContextBuilder::defaultConstructorArguments()
  Update spanish and catalan translations
  Update AbstractSchemaListener.php to adjust more database params
  Updated id=113 Arabic translation.
  #53771 Updated validator Lithuanian translations
  review: translation RU
  [PropertyInfo] Fix PHPStan properties type in trait
  explicitly cast boolean SSL stream options
  ...
  • Loading branch information
xabbuh committed Apr 28, 2024
2 parents c1e0024 + 0d3916a commit c5f718c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -633,12 +633,12 @@ private function getNextEmbedBlock(?int $indentation = null, bool $inSequence =
}

if ($this->isCurrentLineBlank()) {
$data[] = substr($this->currentLine, $newIndent);
$data[] = substr($this->currentLine, $newIndent ?? 0);
continue;
}

if ($indent >= $newIndent) {
$data[] = substr($this->currentLine, $newIndent);
$data[] = substr($this->currentLine, $newIndent ?? 0);
} elseif ($this->isCurrentLineComment()) {
$data[] = $this->currentLine;
} elseif (0 == $indent) {
Expand Down
9 changes: 7 additions & 2 deletions Tests/ParserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1476,13 +1476,13 @@ public static function getBinaryData()
data: !!binary |
SGVsbG8gd29ybGQ=
EOT
],
],
'containing spaces in block scalar' => [
<<<'EOT'
data: !!binary |
SGVs bG8gd 29ybGQ=
EOT
],
],
];
}

Expand Down Expand Up @@ -2967,6 +2967,11 @@ public function testParseIdeographicSpaces()
], $this->parser->parse($expected));
}

public function testSkipBlankLines()
{
$this->assertSame(['foo' => [null]], (new Parser())->parse("foo:\n-\n\n"));
}

private function assertSameData($expected, $actual)
{
$this->assertEquals($expected, $actual);
Expand Down

0 comments on commit c5f718c

Please sign in to comment.