minor #31766 [Yaml] drop support for mappings in multi-line blocks (xabbuh)

This PR was merged into the 5.0-dev branch.

Discussion
----------

[Yaml] drop support for mappings in multi-line blocks

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | yes
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

Commits
-------

b80cff153a drop support for mappings in multi-line blocks
This commit is contained in:
Fabien Potencier 2019-05-31 15:57:36 +03:00
commit f5d15f68af
3 changed files with 8 additions and 3 deletions

View File

@ -1,6 +1,11 @@
CHANGELOG
=========
5.0.0
-----
* Removed support for mappings inside multi-line strings.
4.3.0
-----

View File

@ -392,7 +392,7 @@ class Parser
}
if (false !== strpos($line, ': ')) {
@trigger_error('Support for mapping keys in multi-line blocks is deprecated since Symfony 4.3 and will throw a ParseException in 5.0.', E_USER_DEPRECATED);
throw new ParseException('Mapping values are not allowed in multi-line blocks.', $this->getRealCurrentLineNb() + 1, $this->currentLine, $this->filename);
}
if ('' === trim($line)) {

View File

@ -526,8 +526,8 @@ EOF;
}
/**
* @group legacy
* @expectedDeprecation Support for mapping keys in multi-line blocks is deprecated since Symfony 4.3 and will throw a ParseException in 5.0.
* @expectedException \Symfony\Component\Yaml\Exception\ParseException
* @expectedExceptionMessage Mapping values are not allowed in multi-line blocks at line 2 (near "dbal:wrong").
*/
public function testMappingKeyInMultiLineStringTriggersDeprecationNotice()
{