Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.6k
[HttpFoundation] Standalone query string normalization#4711
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
Uh oh!
There was an error while loading.Please reload this page.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
* | ||
* @return string|null A normalized query string for the Request | ||
* | ||
* @api |
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.
should be removed.
I made the requested changes. |
Can you squash your commits? Thanks. |
Sure, no problem. Hopefully I did it correctly. |
fabpot added a commit that referenced this pull requestJul 2, 2012
Commits-------6296a24 Standalone query string normalizationDiscussion----------[HttpFoundation] Standalone query string normalizationI wanted to leverage query string normalization in a test. I considered copying this code to my own library but I noticed that the only instance data `getQueryString` needed to know from the `Request` was `QUERY_STRING` so I broke the rest out into a standalone static function.---------------------------------------------------------------------------by simensen at 2012-07-02T20:05:59ZI made the requested changes.---------------------------------------------------------------------------by fabpot at 2012-07-02T20:10:27ZCan you squash your commits? Thanks.---------------------------------------------------------------------------by simensen at 2012-07-02T20:16:52ZSure, no problem. Hopefully I did it correctly.
fabpot added a commit that referenced this pull requestSep 19, 2020
This PR was merged into the 5.2-dev branch.Discussion----------[VarDumper] Support for ReflectionAttribute| Q | A| ------------- | ---| Branch? | master| Bug fix? | no| New feature? | yes| Deprecations? | no| Tickets | N/A| License | MIT| Doc PR | not neededVarDumper currently does not understand that certain reflection objects might have attributes attached to it. Dumping a `ReflectionAttribute` just yields `ReflectionAttribute {#4711}` which is not really helpful. This PR attempts to fix this.```ReflectionAttribute {#4711 name: "App\MyAttribute" arguments: array:2 [ 0 => "one" "extra" => "hello" ]}```While working on this, I noticed that class constants (which can be reflected on since PHP 7.1) are just dumped as plain values, so I've also added a caster for `ReflectionClasConstant` as bonus.The full output for the `LotsOfAttributes` fixture class that is included with is PR looks like this:<details>```^ ReflectionClass {#7 +name: "Symfony\Component\VarDumper\Tests\Fixtures\LotsOfAttributes" modifiers: "final" implements: [] constants: array:1 [ 0 => ReflectionClassConstant {#20 +name: "SOME_CONSTANT" +class: "Symfony\Component\VarDumper\Tests\Fixtures\LotsOfAttributes" modifiers: "public" value: "some value" attributes: array:2 [ 0 => ReflectionAttribute {#33 name: "Symfony\Component\VarDumper\Tests\Fixtures\RepeatableAttribute" arguments: array:1 [ 0 => "one" ] } 1 => ReflectionAttribute {#34 name: "Symfony\Component\VarDumper\Tests\Fixtures\RepeatableAttribute" arguments: array:1 [ 0 => "two" ] } ] } ] properties: array:1 [ "someProperty" => ReflectionProperty {#19 +name: "someProperty" +class: "Symfony\Component\VarDumper\Tests\Fixtures\LotsOfAttributes" modifiers: "private" attributes: array:1 [ 0 => ReflectionAttribute {#30 name: "Symfony\Component\VarDumper\Tests\Fixtures\MyAttribute" arguments: array:2 [ 0 => "one" "extra" => "hello" ] } ] } ] methods: array:1 [ "someMethod" => ReflectionMethod {#21 +name: "someMethod" +class: "Symfony\Component\VarDumper\Tests\Fixtures\LotsOfAttributes" returnType: "void" parameters: { $someParameter: ReflectionParameter {#28 +name: "someParameter" position: 0 attributes: array:1 [ 0 => ReflectionAttribute {#42 name: "Symfony\Component\VarDumper\Tests\Fixtures\MyAttribute" arguments: array:1 [ 0 => "three" ] } ] typeHint: "string" } } attributes: array:1 [ 0 => ReflectionAttribute {#27 name: "Symfony\Component\VarDumper\Tests\Fixtures\MyAttribute" arguments: array:1 [ 0 => "two" ] } ] modifiers: "public" } ] attributes: array:1 [ 0 => ReflectionAttribute {#22 name: "Symfony\Component\VarDumper\Tests\Fixtures\MyAttribute" arguments: [] } ] extra: { file: "./src/Symfony/Component/VarDumper/Tests/Fixtures/LotsOfAttributes.php" line: "15 to 28" isUserDefined: true }}```</details>Commits-------34dbf01 [VarDumper] Support for ReflectionAttribute.
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I wanted to leverage query string normalization in a test. I considered copying this code to my own library but I noticed that the only instance data
getQueryString
needed to know from theRequest
wasQUERY_STRING
so I broke the rest out into a standalone static function.