Skip to content

[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

Closed
wants to merge 2 commits into from

Conversation

jeromemacias
Copy link
Contributor

As mentioned in the upgrade guide:

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).

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).
Copy link
Member

@javiereguiluz javiereguiluz left a 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!

@@ -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";}
Copy link
Member

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";}'

@@ -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";}';
Copy link
Member

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";}\'';

@xabbuh
Copy link
Member

xabbuh commented Nov 21, 2017

3.4 is correct, the old example won't work with Symfony 4, but the tag with colon is already deprecated in 3.4

@jeromemacias
Copy link
Contributor Author

@xabbuh Changes done

@weaverryan
Copy link
Member

Thank you Jérôme!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants