You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
bug symfony#37265 [HttpFoundation] use InputBag for Request::$request only if data is coming from a form (nicolas-grekas)
This PR was merged into the 5.1 branch.
Discussion
----------
[HttpFoundation] use InputBag for Request::$request only if data is coming from a form
| Q | A
| ------------- | ---
| Branch? | 5.1
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fixsymfony#37100
| License | MIT
| Doc PR | -
Commits
-------
786ba10 [HttpFoundation] use InputBag for Request::$request only if data is coming from a form
trigger_deprecation('symfony/http-foundation', '5.1', 'Retrieving a non-string value from "%s()" is deprecated, and will throw a "%s" exception in Symfony 6.0, use "%s::all()" instead.', __METHOD__, BadRequestException::class, __CLASS__);
39
+
trigger_deprecation('symfony/http-foundation', '5.1', 'Retrieving a non-string value from "%s()" is deprecated, and will throw a "%s" exception in Symfony 6.0, use "%s::all($key)" instead.', __METHOD__, BadRequestException::class, __CLASS__);
40
40
}
41
41
42
42
return$this === $value ? $default : $value;
43
43
}
44
44
45
45
/**
46
-
* Returns the inputs.
47
-
*
48
-
* @param string|null $key The name of the input to return or null to get them all
46
+
* {@inheritdoc}
49
47
*/
50
48
publicfunctionall(string$key = null): array
51
49
{
52
-
if (null === $key) {
53
-
return$this->parameters;
54
-
}
55
-
56
-
$value = $this->parameters[$key] ?? [];
57
-
if (!\is_array($value)) {
58
-
thrownewBadRequestException(sprintf('Unexpected value for "%s" input, expecting "array", got "%s".', $key, get_debug_type($value)));
$this->expectDeprecation('Since symfony/http-foundation 5.1: Retrieving a non-string value from "Symfony\Component\HttpFoundation\InputBag::get()" is deprecated, and will throw a "Symfony\Component\HttpFoundation\Exception\BadRequestException" exception in Symfony 6.0, use "Symfony\Component\HttpFoundation\InputBag::all()" instead.');
64
+
$this->expectDeprecation('Since symfony/http-foundation 5.1: Retrieving a non-string value from "Symfony\Component\HttpFoundation\InputBag::get()" is deprecated, and will throw a "Symfony\Component\HttpFoundation\Exception\BadRequestException" exception in Symfony 6.0, use "Symfony\Component\HttpFoundation\InputBag::all($key)" instead.');
0 commit comments