-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
Conversation
b4ef2d8
to
7e78c34
Compare
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 |
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.
extracting the state
-> extracting the contents
?
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.
state = content + context/metadata
7e78c34
to
f09d36d
Compare
f09d36d
to
f9b206b
Compare
…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 | |||
|
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 empty line has to be removed
status: needs work |
f9b206b
to
e8afe0b
Compare
comments addressed |
👍 |
Whatever the cloned data structure, resulting ``Data`` objects are always | ||
serializable. | ||
|
||
A cloner applies limits when creating the representation, so that the one |
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.
[...] 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. |
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.
[...] 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 |
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.
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, |
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.
any caster
e8afe0b
to
3033bc7
Compare
addressed |
👍 |
Thank you Nicolas. |
…kas) This PR was merged into the master branch. Discussion ---------- [VarDumper] Adding semantics with metadata Commits ------- 3033bc7 [VarDumper] Adding semantics with metadata
No description provided.