| Conditions | 5 | 
| Paths | 3 | 
| Total Lines | 17 | 
| Code Lines | 8 | 
| Lines | 0 | 
| Ratio | 0 % | 
| Changes | 0 | ||
| 1 | <?php | ||
| 27 | public function execute($command, callable $next) | ||
| 28 |     { | ||
| 29 |         if (!$command->storage) { | ||
| 30 |             throw new \LogicException("Require storage before using this middleware!"); | ||
| 31 | } | ||
| 32 | |||
| 33 |         if (!$command->secured && LoginCommand::CMD !== $command->storage->getLineActiveCmd()) { | ||
| 34 | return $next($command); | ||
| 35 | } | ||
| 36 | |||
| 37 |         if (!$this->isSecureExpired($command->storage)) { | ||
| 38 | return $next($command); | ||
| 39 | } | ||
| 40 | |||
| 41 | $command->switchTo(LoginCommand::class); | ||
| 42 | |||
| 43 | return $next($command); | ||
| 44 | } | ||
| 65 |