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

[Yaml] Deprecate using the non-specific tag #22909

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 14, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion 8 UPGRADE-3.4.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,17 @@ Finder
------

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

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.
3 changes: 3 additions & 0 deletions 3 UPGRADE-4.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
6 changes: 6 additions & 0 deletions 6 src/Symfony/Component/Yaml/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
-----

Expand Down
2 changes: 2 additions & 0 deletions 2 src/Symfony/Component/Yaml/Inline.php
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,8 @@ private static function evaluateScalar($scalar, $flags, $references = array())
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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion 2 src/Symfony/Component/Yaml/Tests/ParserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function testSpecifications($expected, $yaml, $comment, $deprecated)
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]);
}
}

Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.