@@ -32,6 +32,8 @@ public function __construct(
3232 * Returns the parameters.
3333 *
3434 * @param string|null $key The name of the parameter to return or null to get them all
35+ *
36+ * @throws BadRequestException if the value is not an array
3537 */
3638 public function all (?string $ key = null ): array
3739 {
@@ -98,6 +100,8 @@ public function remove(string $key): void
98100
99101 /**
100102 * Returns the alphabetic characters of the parameter value.
103+ *
104+ * @throws UnexpectedValueException if the value cannot be converted to string
101105 */
102106 public function getAlpha (string $ key , string $ default = '' ): string
103107 {
@@ -106,6 +110,8 @@ public function getAlpha(string $key, string $default = ''): string
106110
107111 /**
108112 * Returns the alphabetic characters and digits of the parameter value.
113+ *
114+ * @throws UnexpectedValueException if the value cannot be converted to string
109115 */
110116 public function getAlnum (string $ key , string $ default = '' ): string
111117 {
@@ -114,6 +120,8 @@ public function getAlnum(string $key, string $default = ''): string
114120
115121 /**
116122 * Returns the digits of the parameter value.
123+ *
124+ * @throws UnexpectedValueException if the value cannot be converted to string
117125 */
118126 public function getDigits (string $ key , string $ default = '' ): string
119127 {
@@ -122,6 +130,8 @@ public function getDigits(string $key, string $default = ''): string
122130
123131 /**
124132 * Returns the parameter as string.
133+ *
134+ * @throws UnexpectedValueException if the value cannot be converted to string
125135 */
126136 public function getString (string $ key , string $ default = '' ): string
127137 {
@@ -135,6 +145,8 @@ public function getString(string $key, string $default = ''): string
135145
136146 /**
137147 * Returns the parameter value converted to integer.
148+ *
149+ * @throws UnexpectedValueException if the value cannot be converted to integer
138150 */
139151 public function getInt (string $ key , int $ default = 0 ): int
140152 {
@@ -143,6 +155,8 @@ public function getInt(string $key, int $default = 0): int
143155
144156 /**
145157 * Returns the parameter value converted to boolean.
158+ *
159+ * @throws UnexpectedValueException if the value cannot be converted to a boolean
146160 */
147161 public function getBoolean (string $ key , bool $ default = false ): bool
148162 {
@@ -160,6 +174,8 @@ public function getBoolean(string $key, bool $default = false): bool
160174 * @return ?T
161175 *
162176 * @psalm-return ($default is null ? T|null : T)
177+ *
178+ * @throws UnexpectedValueException if the parameter value cannot be converted to an enum
163179 */
164180 public function getEnum (string $ key , string $ class , ?\BackedEnum $ default = null ): ?\BackedEnum
165181 {
@@ -183,6 +199,9 @@ public function getEnum(string $key, string $class, ?\BackedEnum $default = null
183199 * @param int|array{flags?: int, options?: array} $options Flags from FILTER_* constants
184200 *
185201 * @see https://php.net/filter-var
202+ *
203+ * @throws UnexpectedValueException if the parameter value is a non-stringable object
204+ * @throws UnexpectedValueException if the parameter value is invalid and \FILTER_NULL_ON_FAILURE is not set
186205 */
187206 public function filter (string $ key , mixed $ default = null , int $ filter = \FILTER_DEFAULT , mixed $ options = []): mixed
188207 {
0 commit comments