Skip to content

Commit

Permalink
fix PHP 8.4 deprecation errors (implicitly nullable parameter) (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
dirx authored Jan 23, 2025
1 parent 4c4d81f commit b1f490b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/CallableHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class CallableHandler implements MiddlewareInterface, RequestHandlerInterface
/** @var ResponseFactoryInterface|null */
private $responseFactory;

public function __construct(callable $callable, ResponseFactoryInterface $responseFactory = null)
public function __construct(callable $callable, ?ResponseFactoryInterface $responseFactory = null)
{
$this->callable = $callable;
$this->responseFactory = $responseFactory;
Expand Down
2 changes: 1 addition & 1 deletion src/Dispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class Dispatcher implements RequestHandlerInterface
/**
* Static helper to create and dispatch a request.
*/
public static function run(array $stack, ServerRequestInterface $request = null): ResponseInterface
public static function run(array $stack, ?ServerRequestInterface $request = null): ResponseInterface
{
if ($request === null) {
$request = Factory::createServerRequest('GET', '/');
Expand Down
2 changes: 1 addition & 1 deletion src/HttpErrorException.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class HttpErrorException extends Exception
*
* @param int $code A valid http error code
*/
public static function create(int $code = 500, array $context = [], Throwable $previous = null): self
public static function create(int $code = 500, array $context = [], ?Throwable $previous = null): self
{
if (!isset(self::$phrases[$code])) {
throw new RuntimeException("Http error not valid ({$code})");
Expand Down

0 comments on commit b1f490b

Please sign in to comment.