@@ -40,18 +40,18 @@ discard block |
||
40 | 40 | */ |
41 | 41 | public function load(string $id): ?TokenInterface |
42 | 42 | { |
43 | - try { |
|
43 | + try{ |
|
44 | 44 | $tokenData = $this->session->getSection(self::SESSION_SECTION)->get('token'); |
45 | 45 | $token = Token::unpack($tokenData); |
46 | - } catch (\Throwable $e) { |
|
46 | + }catch (\Throwable $e){ |
|
47 | 47 | throw new TokenStorageException('Unable to load session token', $e->getCode(), $e); |
48 | 48 | } |
49 | 49 | |
50 | - if ($token->getID() !== $id) { |
|
50 | + if ($token->getID() !== $id){ |
|
51 | 51 | return null; |
52 | 52 | } |
53 | 53 | |
54 | - if ($token->getExpiresAt() !== null && $token->getExpiresAt() > new \DateTime()) { |
|
54 | + if ($token->getExpiresAt() !== null && $token->getExpiresAt() > new \DateTime()){ |
|
55 | 55 | $this->delete($token); |
56 | 56 | return null; |
57 | 57 | } |
@@ -64,12 +64,12 @@ discard block |
||
64 | 64 | */ |
65 | 65 | public function create(array $payload, \DateTimeInterface $expiresAt = null): TokenInterface |
66 | 66 | { |
67 | - try { |
|
67 | + try{ |
|
68 | 68 | $token = new Token($this->randomHash(128), $payload, $expiresAt); |
69 | 69 | $this->session->getSection(self::SESSION_SECTION)->set('token', $token->pack()); |
70 | 70 | |
71 | 71 | return $token; |
72 | - } catch (\Throwable $e) { |
|
72 | + }catch (\Throwable $e){ |
|
73 | 73 | throw new TokenStorageException('Unable to create session token', $e->getCode(), $e); |
74 | 74 | } |
75 | 75 | } |