Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b11e522

Browse files
committed
[Yaml] Simplified multi-line mapping condition + updated changelog and upgrade file accordingly
1 parent b8f5a8e commit b11e522

File tree

5 files changed

+11
-7
lines changed

5 files changed

+11
-7
lines changed

UPGRADE-4.3.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,8 @@ Config
55
------
66

77
* Deprecated using environment variables with `cannotBeEmpty()` if the value is validated with `validate()`
8+
9+
Yaml
10+
----
11+
12+
* Using a mapping inside a multi-line string is deprecated and will throw a `ParseException` in 5.0.

UPGRADE-5.0.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,5 +277,5 @@ Workflow
277277
Yaml
278278
----
279279

280-
* The parser is now stricter and will trigger a deprecation notice when a
280+
* The parser is now stricter and will throw a `ParseException` when a
281281
mapping is found inside a multi-line string.

src/Symfony/Component/Yaml/CHANGELOG.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
CHANGELOG
22
=========
33

4-
5.0.0
4+
4.3.0
55
-----
66

7-
* The parser is now stricter and will trigger a deprecation notice when a
8-
mapping is found inside a multi-line string.
7+
* Using a mapping inside a multi-line string is deprecated and will throw a `ParseException` in 5.0.
98

109
4.2.0
1110
-----

src/Symfony/Component/Yaml/Parser.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -391,8 +391,8 @@ private function doParse(string $value, int $flags)
391391
throw new ParseException('Unable to parse.', $this->getRealCurrentLineNb() + 1, $this->currentLine, $this->filename);
392392
}
393393

394-
if ($this->offset >= 1 && strpos($line, ': ')) {
395-
@trigger_error('Support for mapping keys in multiline blocks is deprecated since version 4.1.', E_USER_DEPRECATED);
394+
if (false !== strpos($line, ': ')) {
395+
@trigger_error('Support for mapping keys in multiline blocks is deprecated since version 4.3 and will throw a ParseException in 5.0.', E_USER_DEPRECATED);
396396
}
397397

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

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,7 @@ public function testObjectsSupportDisabledWithExceptions()
527527

528528
/**
529529
* @group legacy
530-
* @expectedDeprecation Support for mapping keys in multiline blocks is deprecated since version 4.1.
530+
* @expectedDeprecation Support for mapping keys in multiline blocks is deprecated since version 4.3 and will throw a ParseException in 5.0.
531531
*/
532532
public function testMappingKeyInMultiLineStringTriggersDeprecationNotice()
533533
{

0 commit comments

Comments
 (0)