diff --git a/src/Application.php b/src/Application.php index cd16517..7728ccf 100644 --- a/src/Application.php +++ b/src/Application.php @@ -52,7 +52,7 @@ public function __construct( EmitterInterface $emitter, MiddlewarePipelineInterface $pipeline, MiddlewareResolverInterface $resolver, - RequestHandlerInterface $default = null + ?RequestHandlerInterface $default = null ) { $this->router = $router; $this->emitter = $emitter; diff --git a/src/Exception/BadRequestHttpException.php b/src/Exception/BadRequestHttpException.php index e04d998..8ad8ed8 100644 --- a/src/Exception/BadRequestHttpException.php +++ b/src/Exception/BadRequestHttpException.php @@ -13,7 +13,7 @@ class BadRequestHttpException extends HttpException * @param string|null $reasonPhrase * @param Throwable|null $previous */ - public function __construct(string $reasonPhrase = null, Throwable $previous = null) + public function __construct(?string $reasonPhrase = null, ?Throwable $previous = null) { parent::__construct(ErrorResponseGeneratorInterface::STATUS_BAD_REQUEST, $reasonPhrase, $previous); } diff --git a/src/Exception/ForbiddenHttpException.php b/src/Exception/ForbiddenHttpException.php index 3e14b9c..ea9ab8e 100644 --- a/src/Exception/ForbiddenHttpException.php +++ b/src/Exception/ForbiddenHttpException.php @@ -13,7 +13,7 @@ class ForbiddenHttpException extends HttpException * @param string|null $reasonPhrase * @param Throwable|null $previous */ - public function __construct(string $reasonPhrase = null, Throwable $previous = null) + public function __construct(?string $reasonPhrase = null, ?Throwable $previous = null) { parent::__construct(ErrorResponseGeneratorInterface::STATUS_FORBIDDEN, $reasonPhrase, $previous); } diff --git a/src/Exception/HttpException.php b/src/Exception/HttpException.php index faca005..eae4aa3 100644 --- a/src/Exception/HttpException.php +++ b/src/Exception/HttpException.php @@ -25,7 +25,7 @@ class HttpException extends Exception * @param string|null $reasonPhrase * @param Throwable|null $previous */ - public function __construct(int $statusCode, string $reasonPhrase = null, Throwable $previous = null) + public function __construct(int $statusCode, ?string $reasonPhrase = null, ?Throwable $previous = null) { $reasonPhrase ??= ''; diff --git a/src/Exception/InternalServerErrorHttpException.php b/src/Exception/InternalServerErrorHttpException.php index 7e73f1b..7afc952 100644 --- a/src/Exception/InternalServerErrorHttpException.php +++ b/src/Exception/InternalServerErrorHttpException.php @@ -13,7 +13,7 @@ class InternalServerErrorHttpException extends HttpException * @param string|null $reasonPhrase * @param Throwable|null $previous */ - public function __construct(string $reasonPhrase = null, Throwable $previous = null) + public function __construct(?string $reasonPhrase = null, ?Throwable $previous = null) { parent::__construct(ErrorResponseGeneratorInterface::STATUS_INTERNAL_SERVER_ERROR, $reasonPhrase, $previous); } diff --git a/src/Exception/MethodNotAllowedHttpException.php b/src/Exception/MethodNotAllowedHttpException.php index d29d330..c439f83 100644 --- a/src/Exception/MethodNotAllowedHttpException.php +++ b/src/Exception/MethodNotAllowedHttpException.php @@ -13,7 +13,7 @@ class MethodNotAllowedHttpException extends HttpException * @param string|null $reasonPhrase * @param Throwable|null $previous */ - public function __construct(string $reasonPhrase = null, Throwable $previous = null) + public function __construct(?string $reasonPhrase = null, ?Throwable $previous = null) { parent::__construct(ErrorResponseGeneratorInterface::STATUS_METHOD_NOT_ALLOWED, $reasonPhrase, $previous); } diff --git a/src/Exception/NotFoundHttpException.php b/src/Exception/NotFoundHttpException.php index f97e8bb..28e9a74 100644 --- a/src/Exception/NotFoundHttpException.php +++ b/src/Exception/NotFoundHttpException.php @@ -13,7 +13,7 @@ class NotFoundHttpException extends HttpException * @param string|null $reasonPhrase * @param Throwable|null $previous */ - public function __construct(string $reasonPhrase = null, Throwable $previous = null) + public function __construct(?string $reasonPhrase = null, ?Throwable $previous = null) { parent::__construct(ErrorResponseGeneratorInterface::STATUS_NOT_FOUND, $reasonPhrase, $previous); } diff --git a/src/Exception/NotImplementedHttpException.php b/src/Exception/NotImplementedHttpException.php index 3af9cad..5554c14 100644 --- a/src/Exception/NotImplementedHttpException.php +++ b/src/Exception/NotImplementedHttpException.php @@ -13,7 +13,7 @@ class NotImplementedHttpException extends HttpException * @param string|null $reasonPhrase * @param Throwable|null $previous */ - public function __construct(string $reasonPhrase = null, Throwable $previous = null) + public function __construct(?string $reasonPhrase = null, ?Throwable $previous = null) { parent::__construct(ErrorResponseGeneratorInterface::STATUS_NOT_IMPLEMENTED, $reasonPhrase, $previous); } diff --git a/src/Exception/UnauthorizedHttpException.php b/src/Exception/UnauthorizedHttpException.php index 75fe263..739165f 100644 --- a/src/Exception/UnauthorizedHttpException.php +++ b/src/Exception/UnauthorizedHttpException.php @@ -13,7 +13,7 @@ class UnauthorizedHttpException extends HttpException * @param string|null $reasonPhrase * @param Throwable|null $previous */ - public function __construct(string $reasonPhrase = null, Throwable $previous = null) + public function __construct(?string $reasonPhrase = null, ?Throwable $previous = null) { parent::__construct(ErrorResponseGeneratorInterface::STATUS_UNAUTHORIZED, $reasonPhrase, $previous); } diff --git a/src/Response/CustomResponseFactory.php b/src/Response/CustomResponseFactory.php index 92d94a7..6d710f9 100644 --- a/src/Response/CustomResponseFactory.php +++ b/src/Response/CustomResponseFactory.php @@ -31,7 +31,7 @@ final class CustomResponseFactory implements ResponseFactoryInterface * @param StreamInterface|string|resource $body * @param string $protocol */ - public function __construct(array $headers = null, $body = 'php://temp', string $protocol = '1.1') + public function __construct(?array $headers = null, $body = 'php://temp', string $protocol = '1.1') { $this->headers = $headers ?? ['Content-Type' => 'text/html; charset=UTF-8']; $this->body = $body;