Skip to content

Commit

Permalink
Merge branch '5.4' into 6.4
Browse files Browse the repository at this point in the history
* 5.4:
  detect wrong e-mail validation modes
  read form values using the chain data accessor
  [Validator] Review Bulgarian (bg) translation
  Reviewed italian translation
  Fix french translation
  call substr() with integer offsets
  review: FR translation
  Update spanish and catalan translations
  Updated id=113 Arabic translation.
  #53771 Updated validator Lithuanian translations
  review: translation RU
  [PropertyInfo] Fix PHPStan properties type in trait
  [Validator] review validators.lv.xlf
  Review translation
  • Loading branch information
xabbuh committed Apr 28, 2024
2 parents e111fe4 + bc780e1 commit 53e8b1e
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 @@ -638,12 +638,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 @@ -1478,13 +1478,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 @@ -2971,6 +2971,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 53e8b1e

Please sign in to comment.