From 949cd960dfd3a7f0df6132390b3deb831c3e481e Mon Sep 17 00:00:00 2001 From: spiralbot Date: Wed, 11 Dec 2024 19:42:31 +0000 Subject: [PATCH] prepare release --- composer.json | 8 ++++---- src/HttpTransportInterface.php | 2 +- src/Transport/CookieTransport.php | 6 +++--- src/Transport/HeaderTransport.php | 2 +- src/TransportRegistry.php | 2 +- tests/Diactoros/UploadedFileFactory.php | 6 +++--- tests/Stub/TestAuthHttpStorage.php | 2 +- tests/Stub/TestAuthHttpToken.php | 2 +- 8 files changed, 15 insertions(+), 15 deletions(-) diff --git a/composer.json b/composer.json index feb0b55..6371a71 100644 --- a/composer.json +++ b/composer.json @@ -34,16 +34,16 @@ "require": { "php": ">=8.1", "ext-json": "*", - "spiral/auth": "^3.15", + "spiral/auth": "^3.14.8", "psr/http-message": "^1.0|^2.0", "psr/http-server-middleware": "^1.0", "psr/event-dispatcher": "^1.0" }, "require-dev": { "phpunit/phpunit": "^10.1", - "spiral/cookies": "^3.15", - "spiral/http": "^3.15", - "spiral/debug": "^3.15", + "spiral/cookies": "^3.14.8", + "spiral/http": "^3.14.8", + "spiral/debug": "^3.14.8", "nyholm/psr7": "^1.5", "vimeo/psalm": "^5.9" }, diff --git a/src/HttpTransportInterface.php b/src/HttpTransportInterface.php index 20e0298..5f8cd3a 100644 --- a/src/HttpTransportInterface.php +++ b/src/HttpTransportInterface.php @@ -24,7 +24,7 @@ public function commitToken( Request $request, Response $response, string $tokenID, - \DateTimeInterface $expiresAt = null + ?\DateTimeInterface $expiresAt = null ): Response; /** diff --git a/src/Transport/CookieTransport.php b/src/Transport/CookieTransport.php index d0add73..8df608a 100644 --- a/src/Transport/CookieTransport.php +++ b/src/Transport/CookieTransport.php @@ -34,8 +34,8 @@ public function fetchToken(Request $request): ?string public function commitToken( Request $request, Response $response, - string $tokenID = null, - \DateTimeInterface $expiresAt = null + ?string $tokenID = null, + ?\DateTimeInterface $expiresAt = null ): Response { /** @var CookieQueue $cookieQueue */ $cookieQueue = $request->getAttribute(CookieQueue::ATTRIBUTE); @@ -82,7 +82,7 @@ public function removeToken(Request $request, Response $response, string $tokenI /** * @return int<0, max>|null */ - private function getLifetime(\DateTimeInterface $expiresAt = null): ?int + private function getLifetime(?\DateTimeInterface $expiresAt = null): ?int { if ($expiresAt === null) { return null; diff --git a/src/Transport/HeaderTransport.php b/src/Transport/HeaderTransport.php index 218a787..2a566c4 100644 --- a/src/Transport/HeaderTransport.php +++ b/src/Transport/HeaderTransport.php @@ -32,7 +32,7 @@ public function commitToken( Request $request, Response $response, string $tokenID, - \DateTimeInterface $expiresAt = null + ?\DateTimeInterface $expiresAt = null ): Response { if ($request->hasHeader($this->header) && $this->extractToken($request) === $tokenID) { return $response; diff --git a/src/TransportRegistry.php b/src/TransportRegistry.php index 252e575..9a19190 100644 --- a/src/TransportRegistry.php +++ b/src/TransportRegistry.php @@ -25,7 +25,7 @@ public function setTransport(string $name, HttpTransportInterface $transport): v $this->transports[$name] = $transport; } - public function getTransport(string $name = null): HttpTransportInterface + public function getTransport(?string $name = null): HttpTransportInterface { $name ??= $this->default; diff --git a/tests/Diactoros/UploadedFileFactory.php b/tests/Diactoros/UploadedFileFactory.php index b9e4aff..80fb7d3 100644 --- a/tests/Diactoros/UploadedFileFactory.php +++ b/tests/Diactoros/UploadedFileFactory.php @@ -16,10 +16,10 @@ final class UploadedFileFactory implements UploadedFileFactoryInterface */ public function createUploadedFile( StreamInterface $stream, - int $size = null, + ?int $size = null, int $error = \UPLOAD_ERR_OK, - string $clientFilename = null, - string $clientMediaType = null + ?string $clientFilename = null, + ?string $clientMediaType = null ): UploadedFileInterface { if ($size === null) { $size = $stream->getSize(); diff --git a/tests/Stub/TestAuthHttpStorage.php b/tests/Stub/TestAuthHttpStorage.php index 9999497..79b445b 100644 --- a/tests/Stub/TestAuthHttpStorage.php +++ b/tests/Stub/TestAuthHttpStorage.php @@ -18,7 +18,7 @@ public function load(string $id): ?TokenInterface return new TestAuthHttpToken($id, ['id' => $id]); } - public function create(array $payload, \DateTimeInterface $expiresAt = null): TokenInterface + public function create(array $payload, ?\DateTimeInterface $expiresAt = null): TokenInterface { return new TestAuthHttpToken( $payload['id'], diff --git a/tests/Stub/TestAuthHttpToken.php b/tests/Stub/TestAuthHttpToken.php index 134584c..892ca02 100644 --- a/tests/Stub/TestAuthHttpToken.php +++ b/tests/Stub/TestAuthHttpToken.php @@ -22,7 +22,7 @@ class TestAuthHttpToken implements TokenInterface * @param array $payload * @param \DateTimeInterface|null $expiresAt */ - public function __construct(string $id, array $payload, \DateTimeInterface $expiresAt = null) + public function __construct(string $id, array $payload, ?\DateTimeInterface $expiresAt = null) { $this->id = $id; $this->expiresAt = $expiresAt;