Mercurial > hg > cmmr2012-drupal-site
comparison vendor/symfony/http-foundation/Session/Storage/MockArraySessionStorage.php @ 4:a9cd425dd02b
Update, including to Drupal core 8.6.10
author | Chris Cannam |
---|---|
date | Thu, 28 Feb 2019 13:11:55 +0000 |
parents | c75dbcec494b |
children |
comparison
equal
deleted
inserted
replaced
3:307d7a7fd348 | 4:a9cd425dd02b |
---|---|
48 protected $closed = false; | 48 protected $closed = false; |
49 | 49 |
50 /** | 50 /** |
51 * @var array | 51 * @var array |
52 */ | 52 */ |
53 protected $data = array(); | 53 protected $data = []; |
54 | 54 |
55 /** | 55 /** |
56 * @var MetadataBag | 56 * @var MetadataBag |
57 */ | 57 */ |
58 protected $metadataBag; | 58 protected $metadataBag; |
59 | 59 |
60 /** | 60 /** |
61 * @var array|SessionBagInterface[] | 61 * @var array|SessionBagInterface[] |
62 */ | 62 */ |
63 protected $bags = array(); | 63 protected $bags = []; |
64 | 64 |
65 /** | 65 /** |
66 * @param string $name Session name | 66 * @param string $name Session name |
67 * @param MetadataBag $metaBag MetadataBag instance | 67 * @param MetadataBag $metaBag MetadataBag instance |
68 */ | 68 */ |
168 foreach ($this->bags as $bag) { | 168 foreach ($this->bags as $bag) { |
169 $bag->clear(); | 169 $bag->clear(); |
170 } | 170 } |
171 | 171 |
172 // clear out the session | 172 // clear out the session |
173 $this->data = array(); | 173 $this->data = []; |
174 | 174 |
175 // reconnect the bags to the session | 175 // reconnect the bags to the session |
176 $this->loadSession(); | 176 $this->loadSession(); |
177 } | 177 } |
178 | 178 |
240 return hash('sha256', uniqid('ss_mock_', true)); | 240 return hash('sha256', uniqid('ss_mock_', true)); |
241 } | 241 } |
242 | 242 |
243 protected function loadSession() | 243 protected function loadSession() |
244 { | 244 { |
245 $bags = array_merge($this->bags, array($this->metadataBag)); | 245 $bags = array_merge($this->bags, [$this->metadataBag]); |
246 | 246 |
247 foreach ($bags as $bag) { | 247 foreach ($bags as $bag) { |
248 $key = $bag->getStorageKey(); | 248 $key = $bag->getStorageKey(); |
249 $this->data[$key] = isset($this->data[$key]) ? $this->data[$key] : array(); | 249 $this->data[$key] = isset($this->data[$key]) ? $this->data[$key] : []; |
250 $bag->initialize($this->data[$key]); | 250 $bag->initialize($this->data[$key]); |
251 } | 251 } |
252 | 252 |
253 $this->started = true; | 253 $this->started = true; |
254 $this->closed = false; | 254 $this->closed = false; |