diff --git a/src/ErrorHandler.php b/src/ErrorHandler.php index 4ba8f20..2288cc5 100644 --- a/src/ErrorHandler.php +++ b/src/ErrorHandler.php @@ -4,8 +4,8 @@ use Buzz\Exception\ClientException; use Jobcloud\Kafka\SchemaRegistryClient\Exception\BackendDatastoreException; -use Jobcloud\Kafka\SchemaRegistryClient\Exception\ImportException; use Jobcloud\Kafka\SchemaRegistryClient\Exception\CompatibilityException; +use Jobcloud\Kafka\SchemaRegistryClient\Exception\ImportException; use Jobcloud\Kafka\SchemaRegistryClient\Exception\IncompatibileAvroSchemaException; use Jobcloud\Kafka\SchemaRegistryClient\Exception\InvalidAvroSchemaException; use Jobcloud\Kafka\SchemaRegistryClient\Exception\InvalidVersionException; @@ -18,10 +18,10 @@ use Jobcloud\Kafka\SchemaRegistryClient\Exception\UnauthorizedException; use Jobcloud\Kafka\SchemaRegistryClient\Exception\UnprocessableEntityException; use Jobcloud\Kafka\SchemaRegistryClient\Exception\VersionNotFoundException; +use JsonException; use Psr\Http\Client\ClientExceptionInterface; use Psr\Http\Message\RequestInterface; use Psr\Http\Message\ResponseInterface; -use JsonException; class ErrorHandler implements ErrorHandlerInterface { @@ -45,8 +45,11 @@ class ErrorHandler implements ErrorHandlerInterface * @throws ClientExceptionInterface * @throws SchemaRegistryExceptionInterface */ - public function handleError(ResponseInterface $response, string $uri = null, RequestInterface $request = null): void - { + public function handleError( + ResponseInterface $response, + ?string $uri = null, + ?RequestInterface $request = null + ): void { $responseContent = json_decode($response->getBody(), true, 512, JSON_THROW_ON_ERROR); if (false === isset($responseContent['error_code'])) { diff --git a/src/ErrorHandlerInterface.php b/src/ErrorHandlerInterface.php index fa22e2b..dc02acf 100644 --- a/src/ErrorHandlerInterface.php +++ b/src/ErrorHandlerInterface.php @@ -17,7 +17,7 @@ interface ErrorHandlerInterface */ public function handleError( ResponseInterface $response, - string $uri = null, - RequestInterface $request = null + ?string $uri = null, + ?RequestInterface $request = null ): void; }