8000 Added deprecation notice when defining an indented block after a defi… · symfony/symfony@083d19e · GitHub
[go: up one dir, main page]

Skip to content

Commit 083d19e

Browse files
committed
Added deprecation notice when defining an indented block after a definition
1 parent 18695c8 commit 083d19e

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/Symfony/Component/Yaml/Parser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ private function doParse(string $value, int $flags)
383383
}
384384

385385
if ($this->offset >= 1 && preg_match('/:/', $this->currentLine) && $this->isNextLineIndented()) {
386-
throw new ParseException('Indented blocks after definition are not allowed', $this->currentLineNb + 1, $this->currentLine, $this->filename);
386+
@trigger_error('Support for indented blocks after definition is deprecated since version 4.1. Use same level of indentation to fix this issue.', E_USER_DEPRECATED);
387387
}
388388

389389
if ('' === trim($line)) {

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,8 @@ public function testObjectsSupportDisabledWithExceptions()
526526
}
527527

528528
/**
529-
* @expectedException \Symfony\Component\Yaml\Exception\ParseException
529+
* @group legacy
530+
* @expectedDeprecation Support for indented blocks after definition is deprecated since version 4.1. Use same level of indentation to fix this issue.
530531
*/
531532
public function testMappingKeyWithAdditionalStringThrowsException()
532533
{

0 commit comments

Comments
 (0)
0