8000 [Yaml] Deprecate using the object and const tag without a value by fancyweb · Pull Request #35368 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Yaml] Deprecate using the object and const tag without a value #35368

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
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
[Yaml] Deprecate using the object and const tag without a value
  • Loading branch information
fancyweb committed Feb 3, 2020
commit 89062b9ba0a026338d6fa7da3dec8b9be3400eee
5 changes: 5 additions & 0 deletions UPGRADE-5.1.md
8000
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,8 @@ Routing
-------

* Deprecated `RouteCollectionBuilder` in favor of `RoutingConfigurator`.

Yaml
----

* Deprecated using the `!php/object` and `!php/const` tags without a value.
1 change: 1 addition & 0 deletions src/Symfony/Component/Yaml/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ CHANGELOG
-----

* Added `yaml-lint` binary.
* Deprecated using the `!php/object` and `!php/const` tags without a value.

5.0.0
-----
Expand Down
4 changes: 4 additions & 0 deletions src/Symfony/Component/Yaml/Inline.php
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,8 @@ private static function evaluateScalar(string $scalar, int $flags, array $refere
case 0 === strpos($scalar, '!php/object'):
if (self::$objectSupport) {
if (!isset($scalar[12])) {
@trigger_error('Using the !php/object tag without a value is deprecated since Symfony 5.1.', E_USER_DEPRECATED);

return false;
}

Expand All @@ -604,6 +606,8 @@ private static function evaluateScalar(string $scalar, int $flags, array $refere
case 0 === strpos($scalar, '!php/const'):
if (self::$constantSupport) {
if (!isset($scalar[11])) {
@trigger_error('Using the !php/const tag without a value is deprecated since Symfony 5.1.', E_USER_DEPRECATED);

return '';
}

Expand Down
8 changes: 8 additions & 0 deletions src/Symfony/Component/Yaml/Tests/InlineTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -740,6 +740,10 @@ public function getTestsForOctalNumbers()

/**
* @dataProvider phpObjectTagWithEmptyValueProvider
*
* @group legacy
*
* @expectedDeprecation Using the !php/object tag without a value is deprecated since Symfony 5.1.
*/
public function testPhpObjectWithEmptyValue($expected, $value)
{
Expand All @@ -760,6 +764,10 @@ public function phpObjectTagWithEmptyValueProvider()

/**
* @dataProvider phpConstTagWithEmptyValueProvider
*
* @group legacy
*
* @expectedDeprecation Using the !php/const tag without a value is deprecated since Symfony 5.1.
*/
public function testPhpConstTagWithEmptyValue($expected, $value)
{
Expand Down
0