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

Added note on YAML mappings as objects#6590

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

Closed

Conversation

@dantleech
Copy link
Contributor

QA
Doc fix?no
New docs?yes
Applies to2.7 > 3.0

Depends on#6582

Yamlmappings_ are basically associative arrays. You can instruct the parser to return
mappings as objects (i.e. ``\stdClass`` instances)::

$object = $parser->parse('{"hello": "world"}', false, false, true);
Copy link
Member

Choose a reason for hiding this comment

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

should make use ofYaml::parse()

@dantleech
Copy link
ContributorAuthor

Updated.

@dantleechdantleechforce-pushed theyaml_object_for_map branch 2 times, most recently from34f243e to983720dCompareMay 21, 2016 16:24
@HeahDude
Copy link
Contributor

HeahDude commentedMay 21, 2016
edited
Loading

closes#6524.


..versionadded::2.7

This feature was introduced in Symfony 2.7
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 move this just below the "Objects for Mappings" headline.

Copy link
Member

Choose a reason for hiding this comment

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

And we can reword this a bit:

Support for parsing mappings as objects was introduced in Symfony 2.7.

echo $object->foo; // bar

..versionadded::2.7

Copy link
Member

Choose a reason for hiding this comment

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

this empty line should be removed (versionadded directive is a strange one)

@dantleech
Copy link
ContributorAuthor

Updated

....................

..versionadded::2.7

Copy link
Member

Choose a reason for hiding this comment

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

after your pushes, it's this line that should be removed

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

yeah i saw :)

@dantleechdantleechforce-pushed theyaml_object_for_map branch 2 times, most recently from83ba2fb to81ea3e2CompareMay 21, 2016 17:14
@dantleech
Copy link
ContributorAuthor

dantleech commentedMay 21, 2016
edited
Loading

Updated

....................

..versionadded::2.6
Support for parsing mappings as objects was introduced in Symfony 2.6.
Copy link
Member

Choose a reason for hiding this comment

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

It was added in 2.7.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Hmm, it was added toParser in 2.6 and andYaml::parse in 2.7 :/

Copy link
Member

Choose a reason for hiding this comment

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

I think we should prefer the static API (see#6598) so using 2.7 here is the best idea imo.

@HeahDude
Copy link
Contributor

👍


Yaml:ref:`mappings<yaml-format-collections>` are basically associative
arrays. You can instruct the parser to return mappings as objects (i.e.
``\stdClass`` instances) by setting the forth argument to ``true``::
Copy link
Contributor

Choose a reason for hiding this comment

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

fourth

@wouterj
Copy link
Member

👍

xabbuh added a commit that referenced this pull requestMay 21, 2016
This PR was submitted for the master branch but it was merged into the 2.7 branch instead (closes#6590).Discussion----------Added note on YAML mappings as objects| Q             | A| ------------- | ---| Doc fix?      | no| New docs?     | yes| Applies to    | 2.7 > 3.0Depends on#6582Commits-------e9de4ca Added note on YAML mappings as objects
xabbuh added a commit that referenced this pull requestMay 21, 2016
@xabbuh
Copy link
Member

Thank you@dantleech!

@xabbuhxabbuh closed thisMay 21, 2016
xabbuh added a commit that referenced this pull requestMay 21, 2016
* 2.7:  Simplified the contribution article for Symfony Docs  Update routing.rst  [#6590] fix version in versionadded directive  Added note on YAML mappings as objects  use static Yaml API  Adding a description for the use_microseconds parameter introduced in MonologBundle v2.11  Clarify signed requests in the ESI renderer
xabbuh added a commit that referenced this pull requestMay 21, 2016
* 2.8:  Simplified the contribution article for Symfony Docs  Update routing.rst  [#6590] fix version in versionadded directive  Added note on YAML mappings as objects  use static Yaml API  Adding a description for the use_microseconds parameter introduced in MonologBundle v2.11  Clarify signed requests in the ESI renderer
xabbuh added a commit that referenced this pull requestMay 21, 2016
* 3.0:  Simplified the contribution article for Symfony Docs  Update routing.rst  [#6590] fix version in versionadded directive  Added note on YAML mappings as objects  use static Yaml API  Adding a description for the use_microseconds parameter introduced in MonologBundle v2.11  Clarify signed requests in the ESI renderer  refs#5898 Fix updates of testing.rst for 3.0
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
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

4 participants

@dantleech@HeahDude@wouterj@xabbuh

[8]ページ先頭

©2009-2025 Movatter.jp