diff --git a/composer.json b/composer.json index 5a9e5ae..3454aae 100644 --- a/composer.json +++ b/composer.json @@ -10,20 +10,20 @@ } ], "require": { - "php": "^7.4 || ~8.0.0 || ~8.1.0", - "psr/http-message": "^1.0.1", + "php": "~8.0.0 || ~8.1.0 || ~8.2.0", + "psr/http-message": "^1.0 || 2.0", "laminas/laminas-servicemanager": "^3.11.2", "laminas/laminas-hydrator": "^4.3.1", "dotkernel/dot-authentication": "^2.1", - "laminas/laminas-dependency-plugin": "^2.2.0" - }, - "require-dev": { - "phpunit/phpunit": "^9.5.20", - "squizlabs/php_codesniffer": "^3.6.2", + "laminas/laminas-authentication": "2.15.0", "laminas/laminas-db": "^2.15.0", "laminas/laminas-session": "^2.12.1", "laminas/laminas-psr7bridge": "^1.6.0" }, + "require-dev": { + "phpunit/phpunit": "^10.3.2", + "squizlabs/php_codesniffer": "^3.7.2" + }, "suggest": { "laminas/laminas-db": "Needed if you are using the CallbackCheckAdapter", "laminas/laminas-session": "Used by the SessionStorage to store authentication identity", diff --git a/src/AuthenticationService.php b/src/AuthenticationService.php index 676ac0a..3f9946b 100644 --- a/src/AuthenticationService.php +++ b/src/AuthenticationService.php @@ -12,6 +12,7 @@ use Dot\Authentication\Adapter\AdapterInterface; use Dot\Authentication\Identity\IdentityInterface; use Dot\Authentication\Storage\StorageInterface; +use Laminas\Authentication\Exception\ExceptionInterface; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; @@ -113,25 +114,24 @@ public function hasIdentity(): bool return !$this->storage->isEmpty(); } + /** - * @return void + * @throws ExceptionInterface */ - public function clearIdentity() + public function clearIdentity(): void { $this->storage->clear(); } + /** - * @param IdentityInterface $identity + * @throws ExceptionInterface */ - public function setIdentity(IdentityInterface $identity) + public function setIdentity(IdentityInterface $identity): void { - $this->storage->write($identity); + $this->storage->write($identity); } - /** - * @return IdentityInterface - */ public function getIdentity(): ?IdentityInterface { return $this->storage->read();