-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[yaml] Fix !php/*
tag should not contain :
at the end for Symfony 4
#8698
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
Conversation
As mentioned in the [upgrade guide](https://github.com/symfony/symfony/blob/master/UPGRADE-4.0.md): > The !php/object: tag was removed in favor of the !php/object tag (without the colon). > The !php/const: tag was removed in favor of the !php/const tag (without the colon).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Jérôme, thanks for fixing this.
@xabbuh please review if this change was made only for Symfony 4 or also for Symfony 3.4. Thanks!
components/yaml.rst
Outdated
@@ -243,7 +243,7 @@ You can dump objects by using the ``DUMP_OBJECT`` flag:: | |||
$object->foo = 'bar'; | |||
|
|||
$dumped = Yaml::dump($object, 2, 4, Yaml::DUMP_OBJECT); | |||
// !php/object:O:8:"stdClass":1:{s:5:"foo";s:7:"bar";} | |||
// !php/object O:8:"stdClass":1:{s:5:"foo";s:7:"bar";} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be // !php/object 'O:8:"stdClass":1:{s:3:"foo";s:3:"bar";}'
components/yaml.rst
Outdated
@@ -269,7 +269,7 @@ By default the parser will encode invalid types as ``null``. You can make the | |||
parser throw exceptions by using the ``PARSE_EXCEPTION_ON_INVALID_TYPE`` | |||
flag:: | |||
|
|||
$yaml = '!php/object:O:8:"stdClass":1:{s:5:"foo";s:7:"bar";}'; | |||
$yaml = '!php/object O:8:"stdClass":1:{s:5:"foo";s:7:"bar";}'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be $yaml = '!php/object \'O:8:"stdClass":1:{s:3:"foo";s:3:"bar";}\'';
3.4 is correct, the old example won't work with Symfony 4, but the tag with colon is already deprecated in 3.4 |
@xabbuh Changes done |
Thank you Jérôme! |
As mentioned in the upgrade guide: