[Yaml] Deprecate using the non-specific tag
This commit is contained in:
parent
b0ede2c9c8
commit
60f5046661
@ -18,3 +18,9 @@ Validator
|
||||
|
||||
* Not setting the `strict` option of the `Choice` constraint to `true` is
|
||||
deprecated and will throw an exception in Symfony 4.0.
|
||||
|
||||
Yaml
|
||||
----
|
||||
|
||||
* Using the non-specific tag `!` is deprecated and will have a different
|
||||
behavior in 4.0. Use a plain integer or `!!float` instead.
|
||||
|
@ -685,3 +685,6 @@ Yaml
|
||||
|
||||
* The constructor arguments `$offset`, `$totalNumberOfLines` and
|
||||
`$skippedLineNumbers` of the `Parser` class were removed.
|
||||
|
||||
* The behavior of the non-specific tag `!` is changed and now forces
|
||||
non-evaluating your values.
|
||||
|
@ -1,6 +1,12 @@
|
||||
CHANGELOG
|
||||
=========
|
||||
|
||||
3.4.0
|
||||
-----
|
||||
|
||||
* Deprecated using the non-specific tag `!` as its behavior will change in 4.0.
|
||||
It will force non-evaluating your values in 4.0. Use plain integers or `!!float` instead.
|
||||
|
||||
3.3.0
|
||||
-----
|
||||
|
||||
|
@ -611,6 +611,8 @@ class Inline
|
||||
case 0 === strpos($scalar, '!str'):
|
||||
return (string) substr($scalar, 5);
|
||||
case 0 === strpos($scalar, '! '):
|
||||
@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);
|
||||
|
||||
return (int) self::parseScalar(substr($scalar, 2), $flags);
|
||||
case 0 === strpos($scalar, '!php/object:'):
|
||||
if (self::$objectSupport) {
|
||||
|
@ -928,6 +928,7 @@ documents: 2
|
||||
|
||||
---
|
||||
test: Explicit typing
|
||||
deprecated: Using the non-specific tag "!" is deprecated since version 3.4 as its behavior will change in 4.0.
|
||||
yaml: |
|
||||
integer: 12
|
||||
also int: ! "12"
|
||||
|
@ -61,7 +61,7 @@ class ParserTest extends TestCase
|
||||
restore_error_handler();
|
||||
|
||||
$this->assertCount(1, $deprecations);
|
||||
$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]);
|
||||
$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]);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user