Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit a20451e

Browse filesBrowse files
committed
[Yaml] Deprecate using the non-specific tag
1 parent c82fe60 commit a20451e
Copy full SHA for a20451e

File tree

6 files changed

+20
-2
lines changed
Filter options

6 files changed

+20
-2
lines changed

‎UPGRADE-3.4.md

Copy file name to clipboardExpand all lines: UPGRADE-3.4.md
+7-1Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,17 @@ Finder
1010
------
1111

1212
* The `Symfony\Component\Finder\Iterator\FilterIterator` class has been
13-
deprecated and will be removed in 4.0 as it used to fix a bug which existed
13+
deprecated and will be removed in 4.0 as it used to fix a bug which existed
1414
before version 5.5.23/5.6.7.
1515

1616
Validator
1717
---------
1818

1919
* Not setting the `strict` option of the `Choice` constraint to `true` is
2020
deprecated and will throw an exception in Symfony 4.0.
21+
22+
Yaml
23+
----
24+
25+
* Using the non-specific tag `!` is deprecated and will have a different
26+
behavior in 4.0. Use a plain integer or `!!float` instead.

‎UPGRADE-4.0.md

Copy file name to clipboardExpand all lines: UPGRADE-4.0.md
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -685,3 +685,6 @@ Yaml
685685

686686
* The constructor arguments `$offset`, `$totalNumberOfLines` and
687687
`$skippedLineNumbers` of the `Parser` class were removed.
688+
689+
* The behavior of the non-specific tag `!` is changed and now forces
690+
non-evaluating your values.

‎src/Symfony/Component/Yaml/CHANGELOG.md

Copy file name to clipboardExpand all lines: src/Symfony/Component/Yaml/CHANGELOG.md
+6Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
CHANGELOG
22
=========
33

4+
3.4.0
5+
-----
6+
7+
* Deprecated using the non-specific tag `!` as its behavior will change in 4.0.
8+
It will force non-evaluating your values in 4.0. Use plain integers or `!!float` instead.
9+
410
3.3.0
511
-----
612

‎src/Symfony/Component/Yaml/Inline.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Yaml/Inline.php
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -611,6 +611,8 @@ private static function evaluateScalar($scalar, $flags, $references = array())
611611
case 0 === strpos($scalar, '!str'):
612612
return (string) substr($scalar, 5);
613613
case 0 === strpos($scalar, '! '):
614+
@trigger_error('Using the non-specific tag "!" is deprecated since version 3.4 as its behavior will change in 4.0. It will force non-evaluating your values in 4.0. Use plain integers or !!float instead.', E_USER_DEPRECATED);
615+
614616
return (int) self::parseScalar(substr($scalar, 2), $flags);
615617
case 0 === strpos($scalar, '!php/object:'):
616618
if (self::$objectSupport) {

‎src/Symfony/Component/Yaml/Tests/Fixtures/YtsSpecificationExamples.yml

Copy file name to clipboardExpand all lines: src/Symfony/Component/Yaml/Tests/Fixtures/YtsSpecificationExamples.yml
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -928,6 +928,7 @@ documents: 2
928928

929929
---
930930
test: Explicit typing
931+
deprecated: Using the non-specific tag "!" is deprecated since version 3.4 as its behavior will change in 4.0.
931932
yaml: |
932933
integer: 12
933934
also int: ! "12"

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Yaml/Tests/ParserTest.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public function testSpecifications($expected, $yaml, $comment, $deprecated)
6161
restore_error_handler();
6262

6363
$this->assertCount(1, $deprecations);
64-
$this->assertContains('Using the comma as a group separator for floats is deprecated since version 3.2 and will be removed in 4.0.', $deprecations[0]);
64+
$this->assertContains(true !== $deprecated ? $deprecated : 'Using the comma as a group separator for floats is deprecated since version 3.2 and will be removed in 4.0.', $deprecations[0]);
6565
}
6666
}
6767

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.