1 | <?php |
||
21 | class RemoteCartStorage extends MultiFieldSession implements CartStorageInterface |
||
22 | { |
||
23 | /** |
||
24 | * @var string The cart name. Used to distinguish carts, if there are different carts stored. |
||
25 | * E.g. site, panel and mobile-app cart. |
||
26 | */ |
||
27 | public $sessionCartId; |
||
28 | |||
29 | const CACHE_DURATION = 60 * 60; // 1 hour |
||
30 | /** |
||
31 | * @var array |
||
32 | */ |
||
33 | protected $data = []; |
||
34 | /** |
||
35 | * @var array |
||
36 | */ |
||
37 | protected $oldData = []; |
||
38 | /** |
||
39 | * @var SettingsStorage |
||
40 | */ |
||
41 | private $settingsStorage; |
||
42 | /** |
||
43 | * @var CacheInterface |
||
44 | */ |
||
45 | private $cache; |
||
46 | /** |
||
47 | * @var User |
||
48 | */ |
||
49 | private $user; |
||
50 | |||
51 | /** |
||
52 | * @var Session |
||
53 | */ |
||
54 | private $session; |
||
55 | |||
56 | public function __construct(Session $session, User $user, SettingsStorage $settingsStorage, CacheInterface $cache, array $config = []) |
||
65 | |||
66 | public function init() |
||
74 | |||
75 | protected function read() |
||
91 | |||
92 | /** |
||
93 | * @param string $remoteData base64 encoded JSON of serialized remotely stored cart items. |
||
94 | * @param string $localData local cart items array. Defaults to `null`, meaning no local data exists |
||
95 | * @return array |
||
96 | */ |
||
97 | private function mergedCartData($remoteData, $localData = null) |
||
108 | |||
109 | protected function getCacheKey() |
||
113 | |||
114 | protected function getStorageKey() |
||
118 | |||
119 | protected function write() |
||
132 | |||
133 | /** |
||
134 | * @var bool |
||
135 | */ |
||
136 | private $_isActive; |
||
137 | |||
138 | public function getIsActive() |
||
142 | |||
143 | /** {@inheritdoc} */ |
||
144 | public function open() |
||
155 | |||
156 | /** {@inheritdoc} */ |
||
157 | public function offsetExists($offset) |
||
163 | |||
164 | /** {@inheritdoc} */ |
||
165 | public function offsetGet($offset) |
||
171 | |||
172 | /** {@inheritdoc} */ |
||
173 | public function offsetSet($offset, $item) |
||
179 | |||
180 | /** {@inheritdoc} */ |
||
181 | public function offsetUnset($offset) |
||
186 | |||
187 | /** |
||
188 | * @throws NotSupportedException |
||
189 | * @void |
||
190 | */ |
||
191 | private function throwShouldNotBeCalledException() |
||
195 | |||
196 | /** {@inheritdoc} */ |
||
197 | public function regenerateID($deleteOldSession = false) |
||
201 | |||
202 | /** {@inheritdoc} */ |
||
203 | public function readSession($id) |
||
207 | |||
208 | /** {@inheritdoc} */ |
||
209 | public function writeSession($id, $data) |
||
213 | |||
214 | /** {@inheritdoc} */ |
||
215 | public function destroySession($id) |
||
219 | |||
220 | /** {@inheritdoc} */ |
||
221 | public function gcSession($maxLifetime) |
||
225 | |||
226 | private function registerShutdownFunction() |
||
230 | } |
||
231 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..