| Conditions | 3 |
| Paths | 2 |
| Total Lines | 16 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 3 |
| Changes | 2 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 16 | 4 | public function invoke(MethodInvocation $invocation) |
|
| 17 | { |
||
| 18 | 4 | $this->session->start(); |
|
| 19 | |||
| 20 | 4 | $metadataBag = $this->session->getMetadataBag(); |
|
| 21 | 4 | $lifetime = $metadataBag->getLifetime(); |
|
| 22 | |||
| 23 | 4 | if ($lifetime > 0 && $metadataBag->getLastUsed() + $lifetime < time()) { |
|
| 24 | 1 | $this->session->invalidate(); |
|
| 25 | 1 | throw new SessionExpiredException('Session has expired.'); |
|
| 26 | } |
||
| 27 | |||
| 28 | 3 | $this->session->migrate(); |
|
| 29 | |||
| 30 | 3 | return $invocation->proceed(); |
|
| 31 | } |
||
| 32 | } |
||
| 33 |