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 0f0e9c3

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

File tree

6 files changed

+21
-3
lines changed
Filter options

6 files changed

+21
-3
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
@@ -5,11 +5,17 @@ Finder
55
------
66

77
* The `Symfony\Component\Finder\Iterator\FilterIterator` class has been
8-
deprecated and will be removed in 4.0 as it used to fix a bug which existed
8+
deprecated and will be removed in 4.0 as it used to fix a bug which existed
99
before version 5.5.23/5.6.7
1010

1111
Validator
1212
---------
1313

1414
* not setting the `strict` option of the `Choice` constraint to `true` is
1515
deprecated and will throw an exception in Symfony 4.0
16+
17+
Yaml
18+
----
19+
20+
* Using the non-specific tag `!` is deprecated and will have a different
21+
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
+4-1Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ FrameworkBundle
301301

302302
* Extending `ConstraintValidatorFactory` is not supported anymore.
303303

304-
* Passing an array of validators or validator aliases as the second argument of
304+
* Passing an array of validators or validator aliases as the second argument of
305305
`ConstraintValidatorFactory::__construct()` has been removed.
306306
Use the service locator instead.
307307

@@ -689,3 +689,6 @@ Yaml
689689

690690
* The constructor arguments `$offset`, `$totalNumberOfLines` and
691691
`$skippedLineNumbers` of the `Parser` class were removed.
692+
693+
* The behavior of the non-specific tag `!` is changed and now forces
694+
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
@@ -610,6 +610,8 @@ private static function evaluateScalar($scalar, $flags, $references = array())
610610
case 0 === strpos($scalar, '!str'):
611611
return (string) substr($scalar, 5);
612612
case 0 === strpos($scalar, '! '):
613+
@trigger_error('Using the non-specific tag "!" is deprecated since version 3.3 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);
614+
613615
return (int) self::parseScalar(substr($scalar, 2), $flags);
614616
case 0 === strpos($scalar, '!php/object:'):
615617
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.3 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.