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:
Yisroel Baum 2026-05-17 10:09:31 +03:00
parent f2bc33592d
commit c6306af73b
Signed by: yisroelbaum
GPG key ID: 0FA60884F75520A9

View file

@ -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);
}
}