feature #35368 [Yaml] Deprecate using the object and const tag without a value (fancyweb)
This PR was merged into the 5.1-dev branch.
Discussion
----------
[Yaml] Deprecate using the object and const tag without a value
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| Deprecations? | yes
| Tickets | https://github.com/symfony/symfony/pull/35332#discussion_r366757204
| License | MIT
| Doc PR | -
WIP because it needs 3.4 merged up into master + https://github.com/symfony/symfony/pull/35332.
Commits
-------
89062b9ba0
[Yaml] Deprecate using the object and const tag without a value
This commit is contained in:
commit
80b003f888
@ -40,3 +40,8 @@ Routing
|
|||||||
-------
|
-------
|
||||||
|
|
||||||
* Deprecated `RouteCollectionBuilder` in favor of `RoutingConfigurator`.
|
* Deprecated `RouteCollectionBuilder` in favor of `RoutingConfigurator`.
|
||||||
|
|
||||||
|
Yaml
|
||||||
|
----
|
||||||
|
|
||||||
|
* Deprecated using the `!php/object` and `!php/const` tags without a value.
|
||||||
|
@ -5,6 +5,7 @@ CHANGELOG
|
|||||||
-----
|
-----
|
||||||
|
|
||||||
* Added `yaml-lint` binary.
|
* Added `yaml-lint` binary.
|
||||||
|
* Deprecated using the `!php/object` and `!php/const` tags without a value.
|
||||||
|
|
||||||
5.0.0
|
5.0.0
|
||||||
-----
|
-----
|
||||||
|
@ -590,6 +590,8 @@ class Inline
|
|||||||
case 0 === strpos($scalar, '!php/object'):
|
case 0 === strpos($scalar, '!php/object'):
|
||||||
if (self::$objectSupport) {
|
if (self::$objectSupport) {
|
||||||
if (!isset($scalar[12])) {
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -604,6 +606,8 @@ class Inline
|
|||||||
case 0 === strpos($scalar, '!php/const'):
|
case 0 === strpos($scalar, '!php/const'):
|
||||||
if (self::$constantSupport) {
|
if (self::$constantSupport) {
|
||||||
if (!isset($scalar[11])) {
|
if (!isset($scalar[11])) {
|
||||||
|
@trigger_error('Using the !php/const tag without a value is deprecated since Symfony 5.1.', E_USER_DEPRECATED);
|
||||||
|
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -740,6 +740,10 @@ class InlineTest extends TestCase
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider phpObjectTagWithEmptyValueProvider
|
* @dataProvider phpObjectTagWithEmptyValueProvider
|
||||||
|
*
|
||||||
|
* @group legacy
|
||||||
|
*
|
||||||
|
* @expectedDeprecation Using the !php/object tag without a value is deprecated since Symfony 5.1.
|
||||||
*/
|
*/
|
||||||
public function testPhpObjectWithEmptyValue($expected, $value)
|
public function testPhpObjectWithEmptyValue($expected, $value)
|
||||||
{
|
{
|
||||||
@ -760,6 +764,10 @@ class InlineTest extends TestCase
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider phpConstTagWithEmptyValueProvider
|
* @dataProvider phpConstTagWithEmptyValueProvider
|
||||||
|
*
|
||||||
|
* @group legacy
|
||||||
|
*
|
||||||
|
* @expectedDeprecation Using the !php/const tag without a value is deprecated since Symfony 5.1.
|
||||||
*/
|
*/
|
||||||
public function testPhpConstTagWithEmptyValue($expected, $value)
|
public function testPhpConstTagWithEmptyValue($expected, $value)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user