Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Documentation for YAML flags added in 3.1#6622

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
weaverryan merged 1 commit intosymfony:3.1fromdantleech:yaml_3_1
Sep 17, 2016

Conversation

dantleech
Copy link
Contributor

Following on from#6590 this PR documents the YAML flags introduced in Symfony 3.1

Invalid Types and Object Serialization
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Advanced Usage: Flags
---------------------

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I thought about adding a table here with the flag, which method it applies to (linking to a section below) and a short description.

@javiereguiluz
Copy link
Member

I've left some comments but this looks really nice. Thank you@dantleech.

@dantleechdantleechforce-pushed theyaml_3_1 branch 3 times, most recently fromee4b701 tod682edeCompareMay 27, 2016 14:08
@dantleech
Copy link
ContributorAuthor

Updated.

@@ -250,6 +233,77 @@ representation of the object.
parsers will likely not recognize the ``php/object`` tag and non-PHP
implementations certainly won't - use with discretion!

Handling Invalid Types
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

before this headline, we should add a line:.. _invalid-types-and-object-serialization: This way, all section links still work across versions.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Well spotted

@@ -127,20 +127,6 @@ error occurred:

.. _components-yaml-dump:

Objects for Mappings
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

We should add a label to the new headline for existing deep links to the section (like you already have done it for the "Invalid Types and Object Serialization" headline).

Copy link
ContributorAuthor

@dantleechdantleechMay 31, 2016
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Added an additional.. _objects-for-mappings is that what you meant?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Yes, but wouldn't that better fit just above the "Using Objects for Maps" headline?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

It is now.

@dantleech
Copy link
ContributorAuthor

Don't know why platform sh failed - it seems to have gone away now,

Also I don't seem to be able to build the docs locally as$ git submodule update --init doesn't seem to do anything.

Handling Invalid Types
~~~~~~~~~~~~~~~~~~~~~~

By default the parser will encode invalid types as "null". You can make the
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I would enclosenull with double backticks instead of quotes.

@HeahDude
Copy link
Contributor

@dantleech Can you please rebase, it seems there are some conflicts. Thanks!

@dantleech
Copy link
ContributorAuthor

Rebased

On Sun, Jun 26, 2016 at 05:37:00AM -0700, Jules Pietri wrote:

[1]@dantleech Can you please rebase, it seems there are some conflicts.
Thanks!


You are receiving this because you were mentioned.
Reply to this email directly, [2]view it on GitHub, or [3]mute the thread.

Reverse link: [4]unknown

References

Visible links

  1. https://github.com/dantleech
  2. Documentation for YAML flags added in 3.1 #6622 (comment)
  3. https://github.com/notifications/unsubscribe/AAgZcQoWdHyH1k4cVymTyLdMBx9-BIRnks5qPnJsgaJpZM4IoXrx
  4. Documentation for YAML flags added in 3.1 #6622 (comment)

@HeahDude
Copy link
Contributor

Looks good, thanks!

Status: Needs Review

$data = new \stdClass(); // by default objects are invalid.
Yaml::parse($data, Yaml::DUMP_EXCEPTION_ON_INVALID_TYPE); // throws an exception

.. _objects-for-mappings:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

This looks like a wrong place, should be up beforeObject Parsing and Dumping subtitle, right?


$date = Yaml::parse('2016-05-27', Yaml::PARSE_DATETIME);
var_dump(get_class($date)); // DateTime

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I would add a note saying that the dumper accepts DateTime (and DateTimeImmutable) objects since 3.1 as well, to dump them as YAML timestamps, without the need for any flag

xabbuh reacted with thumbs up emoji
@weaverryanweaverryan merged commit3895fc9 intosymfony:3.1Sep 17, 2016
weaverryan added a commit that referenced this pull requestSep 17, 2016
This PR was merged into the 3.1 branch.Discussion----------Documentation for YAML flags added in 3.1Following on from#6590 this PR documents the YAML flags introduced in Symfony 3.1Commits-------3895fc9 Documentation for YAML flags added in 3.1
Similarly you can use ``DUMP_EXCEPTION_ON_INVALID_TYPE`` when dumping::

$data = new \stdClass(); // by default objects are invalid.
Yaml::parse($data, Yaml::DUMP_EXCEPTION_ON_INVALID_TYPE); // throws an exception
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 have been dump(), right? I'm making that change now...

wouterj and xabbuh reacted with thumbs up emoji
weaverryan added a commit that referenced this pull requestSep 17, 2016
weaverryan added a commit that referenced this pull requestSep 17, 2016
@xabbuhxabbuh mentioned this pull requestSep 21, 2016
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@weaverryanweaverryanweaverryan left review comments

Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

8 participants
@dantleech@javiereguiluz@HeahDude@weaverryan@stof@wouterj@xabbuh@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp