Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f55c2af

Browse files
committed
[HttpFoundation] deprecated finding deep items in Request and ParameterBag
1 parent ce3b8fd commit f55c2af

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

src/Symfony/Component/HttpFoundation/ParameterBag.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,15 @@ public function add(array $parameters = array())
9999
* @throws \InvalidArgumentException
100100
*
101101
* @api
102+
*
103+
* @deprecated Finding deep items is deprecated since version 2.7, to be removed in 3.0.
102104
*/
103105
public function get($path, $default = null, $deep = false)
104106
{
107+
if (true === $deep) {
108+
trigger_error('Using paths to find deeper items in '.__METHOD__.' is deprecated since version 2.7 and will be removed in 3.0. Filter the returned value in your own code instead.', E_USER_DEPRECATED);
109+
}
110+
105111
if (!$deep || false === $pos = strpos($path, '[')) {
106112
return array_key_exists($path, $this->parameters) ? $this->parameters[$path] : $default;
107113
}

src/Symfony/Component/HttpFoundation/Request.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -743,9 +743,15 @@ public static function getHttpMethodParameterOverride()
743743
* @param bool $deep is parameter deep in multidimensional array
744744
*
745745
* @return mixed
746+
*
747+
* @deprecated Finding deep items is deprecated since version 2.7, to be removed in 3.0.
746748
*/
747749
public function get($key, $default = null, $deep = false)
748750
{
751+
if (true === $deep) {
752+
trigger_error('Using paths to find deeper items in '.__METHOD__.' is deprecated since version 2.7 and will be removed in 3.0. Filter the returned value in your own code instead.', E_USER_DEPRECATED);
753+
}
754+
749755
if ($this !== $result = $this->query->get($key, $this, $deep)) {
750756
return $result;
751757
}

0 commit comments

Comments
 (0)