1 | <?php |
||
9 | class StorableSession implements StorableSessionInterface |
||
10 | { |
||
11 | /** @var SessionIdInterface */ |
||
12 | private $id; |
||
13 | /** @var SessionInterface */ |
||
14 | private $wrappedSession; |
||
15 | /** @var StorageInterface */ |
||
16 | private $storage; |
||
17 | |||
18 | public static function create(StorageInterface $storage):StorableSession |
||
22 | |||
23 | /** |
||
24 | * @internal Should only be called by a storage |
||
25 | */ |
||
26 | public static function fromId( |
||
36 | |||
37 | public function __construct(SessionInterface $wrappedSession, StorageInterface $storage) |
||
43 | |||
44 | /** |
||
45 | * {@inheritdoc} |
||
46 | */ |
||
47 | public function getId() : SessionIdInterface |
||
51 | |||
52 | /** |
||
53 | * {@inheritdoc} |
||
54 | */ |
||
55 | public function set(string $key, $value) |
||
60 | |||
61 | /** |
||
62 | * {@inheritdoc} |
||
63 | */ |
||
64 | public function get(string $key, $default = null) |
||
68 | |||
69 | /** |
||
70 | * {@inheritdoc} |
||
71 | */ |
||
72 | public function remove(string $key) |
||
77 | |||
78 | /** |
||
79 | * {@inheritdoc} |
||
80 | */ |
||
81 | public function clear() |
||
86 | |||
87 | /** |
||
88 | * {@inheritdoc} |
||
89 | */ |
||
90 | public function has(string $key) : bool |
||
94 | |||
95 | /** |
||
96 | * {@inheritdoc} |
||
97 | */ |
||
98 | public function hasChanged() : bool |
||
102 | |||
103 | /** |
||
104 | * {@inheritdoc} |
||
105 | */ |
||
106 | public function isEmpty() : bool |
||
110 | |||
111 | /** |
||
112 | * {@inheritdoc} |
||
113 | */ |
||
114 | public function jsonSerialize() |
||
118 | |||
119 | private function save() |
||
123 | } |
||
124 |