diff --git a/conformance/src/RpTest/AbstractRpTest.php b/conformance/src/RpTest/AbstractRpTest.php index a548d74..fe9201a 100644 --- a/conformance/src/RpTest/AbstractRpTest.php +++ b/conformance/src/RpTest/AbstractRpTest.php @@ -47,7 +47,7 @@ public function getContainer(): ContainerInterface return $this->container; } - public function registerClient(TestInfo $testInfo, array $metadata = [], JWKSet $jwks = null): ClientInterface + public function registerClient(TestInfo $testInfo, array $metadata = [], ?JWKSet $jwks = null): ClientInterface { $issuer = (new IssuerBuilder()) ->build($testInfo->getRpUri() . '/' . $this->getTestId() . '/.well-known/openid-configuration'); diff --git a/src/Exception/OAuth2Exception.php b/src/Exception/OAuth2Exception.php index 8706cec..5eb3cf9 100644 --- a/src/Exception/OAuth2Exception.php +++ b/src/Exception/OAuth2Exception.php @@ -46,7 +46,7 @@ public static function isOAuth2Error(array $data): bool /** * @throws RemoteException */ - public static function fromResponse(ResponseInterface $response, Throwable $previous = null): self + public static function fromResponse(ResponseInterface $response, ?Throwable $previous = null): self { try { /** @psalm-var false|array{error?: string, error_description?: string, error_uri?: string} $data */ @@ -67,7 +67,7 @@ public static function fromResponse(ResponseInterface $response, Throwable $prev * * @psalm-param OAuth2ErrorType $params */ - public static function fromParameters(array $params, Throwable $previous = null): self + public static function fromParameters(array $params, ?Throwable $previous = null): self { if (! static::isOAuth2Error($params)) { throw new InvalidArgumentException('Invalid OAuth2 exception', 0, $previous); @@ -87,7 +87,7 @@ public function __construct( ?string $description = null, ?string $errorUri = null, int $code = 0, - Throwable $previous = null + ?Throwable $previous = null ) { $message = $error; if (null !== $description) { diff --git a/src/Exception/RemoteException.php b/src/Exception/RemoteException.php index a67cab5..38436fe 100644 --- a/src/Exception/RemoteException.php +++ b/src/Exception/RemoteException.php @@ -12,7 +12,7 @@ class RemoteException extends RuntimeException /** @var ResponseInterface */ private $response; - public function __construct(ResponseInterface $response, ?string $message = null, Throwable $previous = null) + public function __construct(ResponseInterface $response, ?string $message = null, ?Throwable $previous = null) { parent::__construct( $message ?? $response->getReasonPhrase(),