From 0f478743b4c87eaa7f535692d81bf1e758cb06d6 Mon Sep 17 00:00:00 2001 From: Nemanja Date: Wed, 3 Sep 2025 00:34:05 +0200 Subject: [PATCH 1/3] feat(CDP-1451): make explicit nullable type --- src/ErrorHandler.php | 2 +- src/ErrorHandlerInterface.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ErrorHandler.php b/src/ErrorHandler.php index 4ba8f20..aa16af1 100644 --- a/src/ErrorHandler.php +++ b/src/ErrorHandler.php @@ -45,7 +45,7 @@ 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); 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; } From 2b07c66c74c83ec3a9a2b945bc121d71fff145f5 Mon Sep 17 00:00:00 2001 From: Nemanja Date: Thu, 4 Sep 2025 13:06:57 +0200 Subject: [PATCH 2/3] feat(CDP-1451): fix code style --- src/ErrorHandler.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/ErrorHandler.php b/src/ErrorHandler.php index aa16af1..1601168 100644 --- a/src/ErrorHandler.php +++ b/src/ErrorHandler.php @@ -45,7 +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); From fe4ac84c0ce4a608ad0998d65613a6edf175722a Mon Sep 17 00:00:00 2001 From: Nemanja Date: Thu, 4 Sep 2025 13:08:47 +0200 Subject: [PATCH 3/3] feat(CDP-1451): fix --- src/ErrorHandler.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/ErrorHandler.php b/src/ErrorHandler.php index 1601168..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 { @@ -49,8 +49,7 @@ public function handleError( ResponseInterface $response, ?string $uri = null, ?RequestInterface $request = null - ): void - { + ): void { $responseContent = json_decode($response->getBody(), true, 512, JSON_THROW_ON_ERROR); if (false === isset($responseContent['error_code'])) {