Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Optimization: no need to check session container when checking if the…
… token needs refresh * an empty or invalid token will produce an empty session container * an empty session container, if not changed, will not be refreshed * a valid token with an empty session will be left to expire anyway * a valid token with a non-empty session will be refreshed This also removes a mutation that caused our CI to fail: ``` 1) /home/ocramius/Documents/psr7-sessions/storageless/src/Storageless/Http/SessionMiddleware.php:215 [M] NotIdentical --- Original +++ New @@ @@ { $refreshTime = $this->clock->now()->sub(new DateInterval(sprintf('PT%sS', $this->refreshTime))); assert($refreshTime !== false); - return $token !== null && $token->hasBeenIssuedBefore($refreshTime); + return $token === null && $token->hasBeenIssuedBefore($refreshTime); } /** @throws BadMethodCallException */ private function getTokenCookie(SessionInterface $sessionContainer) : SetCookie [warning] Dashboard report has not been sent: The current process is not executed in a CI build Time: 9s. Memory: 0.10GB [ERROR] The minimum required MSI percentage should be 100%, but actual is 97.3%. Improve your tests! ```
- Loading branch information