streamline find by token in session repo
This commit is contained in:
parent
3ebb2c14b3
commit
453e8284b4
1 changed files with 2 additions and 3 deletions
|
|
@ -26,12 +26,11 @@ class FakeSessionRepository implements SessionRepository
|
||||||
|
|
||||||
public function findByToken(string $token): ?Session
|
public function findByToken(string $token): ?Session
|
||||||
{
|
{
|
||||||
if (! isset($this->sessionsByToken[$token])) {
|
$session = $this->sessionsByToken[$token] ?? null;
|
||||||
|
if ($session === null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
$stored = $this->sessionsByToken[$token];
|
|
||||||
|
|
||||||
return new Session(
|
return new Session(
|
||||||
token: $session->getToken(),
|
token: $session->getToken(),
|
||||||
user: $session->getUser(),
|
user: $session->getUser(),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue