Skip to content

Commit 5df0711

Browse files
committed
Fix for PHP 8.4
1 parent be288a2 commit 5df0711

10 files changed

+10
-10
lines changed

src/Application.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public function __construct(
5252
EmitterInterface $emitter,
5353
MiddlewarePipelineInterface $pipeline,
5454
MiddlewareResolverInterface $resolver,
55-
RequestHandlerInterface $default = null
55+
?RequestHandlerInterface $default = null
5656
) {
5757
$this->router = $router;
5858
$this->emitter = $emitter;

src/Exception/BadRequestHttpException.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class BadRequestHttpException extends HttpException
1313
* @param string|null $reasonPhrase
1414
* @param Throwable|null $previous
1515
*/
16-
public function __construct(string $reasonPhrase = null, Throwable $previous = null)
16+
public function __construct(?string $reasonPhrase = null, ?Throwable $previous = null)
1717
{
1818
parent::__construct(ErrorResponseGeneratorInterface::STATUS_BAD_REQUEST, $reasonPhrase, $previous);
1919
}

src/Exception/ForbiddenHttpException.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class ForbiddenHttpException extends HttpException
1313
* @param string|null $reasonPhrase
1414
* @param Throwable|null $previous
1515
*/
16-
public function __construct(string $reasonPhrase = null, Throwable $previous = null)
16+
public function __construct(?string $reasonPhrase = null, ?Throwable $previous = null)
1717
{
1818
parent::__construct(ErrorResponseGeneratorInterface::STATUS_FORBIDDEN, $reasonPhrase, $previous);
1919
}

src/Exception/HttpException.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class HttpException extends Exception
2525
* @param string|null $reasonPhrase
2626
* @param Throwable|null $previous
2727
*/
28-
public function __construct(int $statusCode, string $reasonPhrase = null, Throwable $previous = null)
28+
public function __construct(int $statusCode, ?string $reasonPhrase = null, ?Throwable $previous = null)
2929
{
3030
$reasonPhrase ??= '';
3131

src/Exception/InternalServerErrorHttpException.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class InternalServerErrorHttpException extends HttpException
1313
* @param string|null $reasonPhrase
1414
* @param Throwable|null $previous
1515
*/
16-
public function __construct(string $reasonPhrase = null, Throwable $previous = null)
16+
public function __construct(?string $reasonPhrase = null, ?Throwable $previous = null)
1717
{
1818
parent::__construct(ErrorResponseGeneratorInterface::STATUS_INTERNAL_SERVER_ERROR, $reasonPhrase, $previous);
1919
}

src/Exception/MethodNotAllowedHttpException.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class MethodNotAllowedHttpException extends HttpException
1313
* @param string|null $reasonPhrase
1414
* @param Throwable|null $previous
1515
*/
16-
public function __construct(string $reasonPhrase = null, Throwable $previous = null)
16+
public function __construct(?string $reasonPhrase = null, ?Throwable $previous = null)
1717
{
1818
parent::__construct(ErrorResponseGeneratorInterface::STATUS_METHOD_NOT_ALLOWED, $reasonPhrase, $previous);
1919
}

src/Exception/NotFoundHttpException.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class NotFoundHttpException extends HttpException
1313
* @param string|null $reasonPhrase
1414
* @param Throwable|null $previous
1515
*/
16-
public function __construct(string $reasonPhrase = null, Throwable $previous = null)
16+
public function __construct(?string $reasonPhrase = null, ?Throwable $previous = null)
1717
{
1818
parent::__construct(ErrorResponseGeneratorInterface::STATUS_NOT_FOUND, $reasonPhrase, $previous);
1919
}

src/Exception/NotImplementedHttpException.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class NotImplementedHttpException extends HttpException
1313
* @param string|null $reasonPhrase
1414
* @param Throwable|null $previous
1515
*/
16-
public function __construct(string $reasonPhrase = null, Throwable $previous = null)
16+
public function __construct(?string $reasonPhrase = null, ?Throwable $previous = null)
1717
{
1818
parent::__construct(ErrorResponseGeneratorInterface::STATUS_NOT_IMPLEMENTED, $reasonPhrase, $previous);
1919
}

src/Exception/UnauthorizedHttpException.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class UnauthorizedHttpException extends HttpException
1313
* @param string|null $reasonPhrase
1414
* @param Throwable|null $previous
1515
*/
16-
public function __construct(string $reasonPhrase = null, Throwable $previous = null)
16+
public function __construct(?string $reasonPhrase = null, ?Throwable $previous = null)
1717
{
1818
parent::__construct(ErrorResponseGeneratorInterface::STATUS_UNAUTHORIZED, $reasonPhrase, $previous);
1919
}

src/Response/CustomResponseFactory.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ final class CustomResponseFactory implements ResponseFactoryInterface
3131
* @param StreamInterface|string|resource $body
3232
* @param string $protocol
3333
*/
34-
public function __construct(array $headers = null, $body = 'php://temp', string $protocol = '1.1')
34+
public function __construct(?array $headers = null, $body = 'php://temp', string $protocol = '1.1')
3535
{
3636
$this->headers = $headers ?? ['Content-Type' => 'text/html; charset=UTF-8'];
3737
$this->body = $body;

0 commit comments

Comments
 (0)