Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
1 / 1
CRAP
100.00% covered (success)
100.00%
1 / 1
InMemoryPersistentSessionStorageFactory
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
1 / 1
2
100.00% covered (success)
100.00%
1 / 1
 createStorage
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
1 / 1
2
1<?php
2namespace Apie\IntegrationTests\Applications\Symfony;
3
4use Symfony\Component\HttpFoundation\Request;
5use Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage;
6use Symfony\Component\HttpFoundation\Session\Storage\SessionStorageFactoryInterface;
7use Symfony\Component\HttpFoundation\Session\Storage\SessionStorageInterface;
8
9class 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}