diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8e498bd..930038b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - php-versions: [ '8.0', '8.1', '8.2', '8.3'] + php-versions: ['8.1', '8.2', '8.3'] phpunit-versions: [ 'latest' ] name: PHP ${{ matrix.php-versions }} Test steps: diff --git a/composer.json b/composer.json index 693f92d..e2e5fc6 100644 --- a/composer.json +++ b/composer.json @@ -10,7 +10,7 @@ } ], "require": { - "php": "^8.3", + "php": "^8.1", "ext-crypto": "*", "koriym/http-constants": "^1.1", "psr/http-message": "^1.0", diff --git a/src/Client/GuzzleClient.php b/src/Client/GuzzleClient.php index 4ad2367..f631a93 100644 --- a/src/Client/GuzzleClient.php +++ b/src/Client/GuzzleClient.php @@ -27,7 +27,7 @@ public function request(string $method, string $url, array $params = []): Respon try { return $this->client->request($method, $url, [$this->bodyType($method) => $params]); } catch (GuzzleException $e) { - throw new ClientException($e->getMessage(), (int) $e->getCode()); + throw new ClientException($e->getMessage(), $e->getCode()); } } diff --git a/src/Sesame.php b/src/Sesame.php index 7a02ee5..c5ca7fe 100644 --- a/src/Sesame.php +++ b/src/Sesame.php @@ -31,7 +31,7 @@ public function __invoke(string $uuid, ActionInterface $action): SesamiResponseI return $this->responseFactory->create($response); } catch (ClientException $e) { - throw new SesameException($e->getMessage(), (int) $e->getCode()); + throw new SesameException($e->getMessage(), $e->getCode()); } } @@ -47,6 +47,6 @@ public static function newInstance(string $apiKey, array $options = []): self private function buildUri(string $uuid, ActionInterface $action): string { - return sprintf('https://app.candyhouse.co/api/sesame2/%s%s', $uuid, (string) $action); + return sprintf('https://app.candyhouse.co/api/sesame2/%s%s', $uuid, $action); } } diff --git a/src/SesamiResponse.php b/src/SesamiResponse.php index 0d248b0..841a958 100644 --- a/src/SesamiResponse.php +++ b/src/SesamiResponse.php @@ -8,10 +8,10 @@ use Chanshige\SmartLock\Extend\Json; use Psr\Http\Message\ResponseInterface as PsrResponseInterface; -final readonly class SesamiResponse implements SesamiResponseInterface +final class SesamiResponse implements SesamiResponseInterface { public function __construct( - private PsrResponseInterface $response, + private readonly PsrResponseInterface $response, ) { }