Skip to content
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

[VarDumper] Adding semantics with metadata #6946

Merged
merged 1 commit into from
Oct 14, 2016

Conversation

nicolas-grekas
Copy link
Member

No description provided.

The VarDumper component provides mechanisms for walking through any
arbitrary PHP variable. Built on top, it provides a better ``dump()``
function that you can use instead of :phpfunction:`var_dump`.
The VarDumper component provides mechanisms for extracting the state out of
Copy link
Member

Choose a reason for hiding this comment

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

extracting the state -> extracting the contents ?

Copy link
Member Author

Choose a reason for hiding this comment

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

state = content + context/metadata

fabpot added a commit to symfony/symfony that referenced this pull request Sep 2, 2016
…identifiers (nicolas-grekas)

This PR was merged into the 3.2-dev branch.

Discussion
----------

[VarDumper] Add ClassStub for clickable & shorter PHP identifiers

| Q             | A
| ------------- | ---
| Branch?       | master
| New feature?  | yes
| Tests pass?   | yes
| License       | MIT
| Doc PR        | symfony/symfony-docs#6946

Tells dumpers when PHP identifiers are used so that they can shorten the namespace and create IDE links to the source.

![capture du 2016-09-02 17-07-06](https://cloud.githubusercontent.com/assets/243674/18208461/df2c9684-712f-11e6-9fea-de13e21f86c3.png)

(PR also embeds some fixes/cleanups)

Commits
-------

788f7e8 [VarDumper] Add ClassStub for clickable & shorter PHP identifiers
@@ -154,6 +156,14 @@ Another option for doing the same could be::

// $output is now populated with the dump representation of $variable

.. versionadded:: 3.2

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 has to be removed

@wouterj
Copy link
Member

wouterj commented Sep 3, 2016

status: needs work

@nicolas-grekas
Copy link
Member Author

nicolas-grekas commented Sep 14, 2016

comments addressed

@wouterj
Copy link
Member

wouterj commented Sep 18, 2016

👍
status: reviewed

Whatever the cloned data structure, resulting ``Data`` objects are always
serializable.

A cloner applies limits when creating the representation, so that the one
Copy link
Member

Choose a reason for hiding this comment

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

[...] the cloned one [...]

$output = $dumper->dump($cloner->cloneVar($variable), true);

.. versionadded:: 3.2
The ability to return as string was introduced in Symfony 3.2.
Copy link
Member

Choose a reason for hiding this comment

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

[...] to return a string [...]

@@ -240,3 +257,50 @@ properties not in the class declaration).
.. tip::

Before writing your own casters, you should check the existing ones.

Adding semantics with metadata
Copy link
Member

Choose a reason for hiding this comment

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

Adding Semantics with Metadata


Since casters are hooked on specific classes or interfaces, they know about the
objects they manipulate. By altering the ``$stub`` object (the third argument of
any casters), one can transfer this knowledge to the resulting ``Data`` object,
Copy link
Member

Choose a reason for hiding this comment

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

any caster

@nicolas-grekas
Copy link
Member Author

addressed

@javiereguiluz
Copy link
Member

👍

@xabbuh
Copy link
Member

xabbuh commented Oct 14, 2016

Thank you Nicolas.

@xabbuh xabbuh merged commit 3033bc7 into symfony:master Oct 14, 2016
xabbuh added a commit that referenced this pull request Oct 14, 2016
…kas)

This PR was merged into the master branch.

Discussion
----------

[VarDumper] Adding semantics with metadata

Commits
-------

3033bc7 [VarDumper] Adding semantics with metadata
@nicolas-grekas nicolas-grekas deleted the var-dumper-32 branch October 21, 2016 06:23
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.

None yet

5 participants