implement: move null/empty token guard into logout use case
Green phase: execute() accepts ?string, returns early for null or empty string, otherwise delegates to repository.
This commit is contained in:
parent
f2bc33592d
commit
c6306af73b
1 changed files with 5 additions and 1 deletions
|
|
@ -11,8 +11,12 @@ class Logout
|
|||
) {
|
||||
}
|
||||
|
||||
public function execute(string $token): void
|
||||
public function execute(?string $token): void
|
||||
{
|
||||
if (! is_string($token) || $token === '') {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->sessionRepo->deleteByToken($token);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue