@@ -154,12 +154,12 @@ public function withStatus($code, $reasonPhrase = '')
154154 }
155155
156156 /**
157- * @param $data
157+ * @param array|null $data
158158 * @param $code
159159 * @param array $headers
160160 * @return Response|static
161161 */
162- public function withArray (array $ data , $ code = 200 , array $ headers = [])
162+ public function withArray ($ data , $ code = 200 , array $ headers = [])
163163 {
164164 $ new = clone $ this ;
165165 $ new ->setStatusCode ($ code );
@@ -257,7 +257,7 @@ public function withError($message, $code, array $headers = [])
257257 * @param array $headers
258258 * @return mixed
259259 */
260- public function errorForbidden ($ message = '' , array $ headers = [])
260+ public function errorForbidden (string $ message = '' , array $ headers = [])
261261 {
262262 return $ this ->withError ($ message , 403 , $ headers );
263263 }
@@ -269,7 +269,7 @@ public function errorForbidden($message = '', array $headers = [])
269269 * @param array $headers
270270 * @return mixed
271271 */
272- public function errorInternalError ($ message = '' , array $ headers = [])
272+ public function errorInternalError (string $ message = '' , array $ headers = [])
273273 {
274274 return $ this ->withError ($ message , 500 , $ headers );
275275 }
@@ -281,7 +281,7 @@ public function errorInternalError($message = '', array $headers = [])
281281 * @param array $headers
282282 * @return mixed
283283 */
284- public function errorNotFound ($ message = '' , array $ headers = [])
284+ public function errorNotFound (string $ message = '' , array $ headers = [])
285285 {
286286 return $ this ->withError ($ message , 404 , $ headers );
287287 }
@@ -293,7 +293,7 @@ public function errorNotFound($message = '', array $headers = [])
293293 * @param array $headers
294294 * @return mixed
295295 */
296- public function errorUnauthorized ($ message = '' , array $ headers = [])
296+ public function errorUnauthorized (string $ message = '' , array $ headers = [])
297297 {
298298 return $ this ->withError ($ message , 401 , $ headers );
299299 }
@@ -317,7 +317,7 @@ public function errorWrongArgs(array $message, array $headers = [])
317317 * @param array $headers
318318 * @return mixed
319319 */
320- public function errorGone ($ message = '' , array $ headers = [])
320+ public function errorGone (string $ message = '' , array $ headers = [])
321321 {
322322 return $ this ->withError ($ message , 410 , $ headers );
323323 }
@@ -329,7 +329,7 @@ public function errorGone($message = '', array $headers = [])
329329 * @param array $headers
330330 * @return mixed
331331 */
332- public function errorMethodNotAllowed ($ message = '' , array $ headers = [])
332+ public function errorMethodNotAllowed (string $ message = '' , array $ headers = [])
333333 {
334334 return $ this ->withError ($ message , 405 , $ headers );
335335 }
@@ -341,7 +341,7 @@ public function errorMethodNotAllowed($message = '', array $headers = [])
341341 * @param array $headers
342342 * @return mixed
343343 */
344- public function errorUnwillingToProcess ($ message = '' , array $ headers = [])
344+ public function errorUnwillingToProcess (string $ message = '' , array $ headers = [])
345345 {
346346 return $ this ->withError ($ message , 431 , $ headers );
347347 }
@@ -353,7 +353,7 @@ public function errorUnwillingToProcess($message = '', array $headers = [])
353353 * @param array $headers
354354 * @return mixed
355355 */
356- public function errorUnprocessable ($ message = '' , array $ headers = [])
356+ public function errorUnprocessable (string $ message = '' , array $ headers = [])
357357 {
358358 return $ this ->withError ($ message , 422 , $ headers );
359359 }
@@ -364,7 +364,7 @@ public function errorUnprocessable($message = '', array $headers = [])
364364 * @param int $code
365365 * @throws InvalidArgumentException on an invalid status code.
366366 */
367- private function setStatusCode ($ code )
367+ private function setStatusCode (int $ code )
368368 {
369369 if (! is_numeric ($ code )
370370 || is_float ($ code )
0 commit comments