Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
100.00% |
3 / 3 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
1 / 1 |
InMemoryPersistentSessionStorageFactory | |
100.00% |
3 / 3 |
|
100.00% |
1 / 1 |
2 | |
100.00% |
1 / 1 |
createStorage | |
100.00% |
3 / 3 |
|
100.00% |
1 / 1 |
2 |
1 | <?php |
2 | namespace Apie\IntegrationTests\Applications\Symfony; |
3 | |
4 | use Symfony\Component\HttpFoundation\Request; |
5 | use Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage; |
6 | use Symfony\Component\HttpFoundation\Session\Storage\SessionStorageFactoryInterface; |
7 | use Symfony\Component\HttpFoundation\Session\Storage\SessionStorageInterface; |
8 | |
9 | class InMemoryPersistentSessionStorageFactory implements SessionStorageFactoryInterface |
10 | { |
11 | private SessionStorageInterface $sessionStorage; |
12 | |
13 | public function createStorage(?Request $request): SessionStorageInterface |
14 | { |
15 | if (!isset($this->sessionStorage)) { |
16 | $this->sessionStorage = new MockArraySessionStorage(); |
17 | } |
18 | |
19 | return $this->sessionStorage; |
20 | } |
21 | } |