Skip to content

Commit cb880a4

Browse files
committed
chore(http-foundation): add better type information using phpdoc
Signed-off-by: azjezz <[email protected]>
1 parent e48850b commit cb880a4

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

src/Symfony/Component/HttpFoundation/InputBag.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,20 @@
1717
/**
1818
* InputBag is a container for user input values such as $_GET, $_POST, $_REQUEST, and $_COOKIE.
1919
*
20+
* @template TInput of string|int|float|bool|null
21+
*
2022
* @author Saif Eddin Gmati <[email protected]>
2123
*/
2224
final class InputBag extends ParameterBag
2325
{
2426
/**
2527
* Returns a scalar input value by name.
2628
*
27-
* @param string|int|float|bool|null $default The default value if the input key does not exist
29+
* @template TDefault of string|int|float|bool|null
30+
*
31+
* @param TDefault $default The default value if the input key does not exist
32+
*
33+
* @return TDefault|TInput
2834
*
2935
* @throws BadRequestException if the input contains a non-scalar value
3036
*/

src/Symfony/Component/HttpFoundation/Request.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@ class Request
9595

9696
/**
9797
* Query string parameters ($_GET).
98+
*
99+
* @var InputBag<string>
98100
*/
99101
public InputBag $query;
100102

@@ -110,6 +112,8 @@ class Request
110112

111113
/**
112114
* Cookies ($_COOKIE).
115+
*
116+
* @var InputBag<string>
113117
*/
114118
public InputBag $cookies;
115119

0 commit comments

Comments
 (0)