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

Appearance settings

Commit da1c1c5

Browse filesBrowse files
committed
minor #12537 [HttpFoundation] Make Request::get() more performant (KorvinSzanto, xabbuh)
This PR was submitted for the 2.7 branch but it was merged into the 2.3 branch instead (closes #12537). Discussion ---------- [HttpFoundation] Make Request::get() more performant | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | This finishes the work started by @KorvinSzanto in #12369. Commits ------- 3039935 reformat code as suggested by @fabpot ad64223 Fix typo 4162713 Make `\Request::get` more performant.
2 parents ce36821 + 3039935 commit da1c1c5
Copy full SHA for da1c1c5

File tree

Expand file treeCollapse file tree

1 file changed

+13
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+13
-1
lines changed

‎src/Symfony/Component/HttpFoundation/Request.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpFoundation/Request.php
+13-1Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,19 @@ public static function getHttpMethodParameterOverride()
692692
*/
693693
public function get($key, $default = null, $deep = false)
694694
{
695-
return $this->query->get($key, $this->attributes->get($key, $this->request->get($key, $default, $deep), $deep), $deep);
695+
if ($this !== $result = $this->query->get($key, $this, $deep)) {
696+
return $result;
697+
}
698+
699+
if ($this !== $result = $this->attributes->get($key, $this, $deep)) {
700+
return $result;
701+
}
702+
703+
if ($this !== $result = $this->request->get($key, $this, $deep)) {
704+
return $result;
705+
}
706+
707+
return $default;
696708
}
697709

698710
/**

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.