Skip to content

Fix PHP 8.4 deprecation about implicit nullable types #59

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion conformance/src/RpTest/AbstractRpTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
6 changes: 3 additions & 3 deletions src/Exception/OAuth2Exception.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand All @@ -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);
Expand All @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion src/Exception/RemoteException.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down