Skip to content

Commit 4162713

Browse files
KorvinSzantofabpot
authored andcommitted
Make \Request::get more performant.
1 parent ce36821 commit 4162713

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/Symfony/Component/HttpFoundation/Request.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,17 @@ 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+
$result = $this->query($key, $this, $deep);
696+
if ($result === $this) {
697+
$result = $this->attributes->get($key, $this, $deep);
698+
}
699+
if ($result === $this) {
700+
$result = $this->request->get($key, $this, $deep);
701+
}
702+
if ($result === $this) {
703+
return $default;
704+
}
705+
return $result;
696706
}
697707

698708
/**

0 commit comments

Comments
 (0)