Mercurial > hg > isophonics-drupal-site
comparison vendor/symfony/http-foundation/Session/Flash/FlashBag.php @ 17:129ea1e6d783
Update, including to Drupal core 8.6.10
author | Chris Cannam |
---|---|
date | Thu, 28 Feb 2019 13:21:36 +0000 |
parents | 1fec387a4317 |
children | af1871eacc83 |
comparison
equal
deleted
inserted
replaced
16:c2387f117808 | 17:129ea1e6d783 |
---|---|
17 * @author Drak <drak@zikula.org> | 17 * @author Drak <drak@zikula.org> |
18 */ | 18 */ |
19 class FlashBag implements FlashBagInterface | 19 class FlashBag implements FlashBagInterface |
20 { | 20 { |
21 private $name = 'flashes'; | 21 private $name = 'flashes'; |
22 private $flashes = array(); | 22 private $flashes = []; |
23 private $storageKey; | 23 private $storageKey; |
24 | 24 |
25 /** | 25 /** |
26 * @param string $storageKey The key used to store flashes in the session | 26 * @param string $storageKey The key used to store flashes in the session |
27 */ | 27 */ |
60 } | 60 } |
61 | 61 |
62 /** | 62 /** |
63 * {@inheritdoc} | 63 * {@inheritdoc} |
64 */ | 64 */ |
65 public function peek($type, array $default = array()) | 65 public function peek($type, array $default = []) |
66 { | 66 { |
67 return $this->has($type) ? $this->flashes[$type] : $default; | 67 return $this->has($type) ? $this->flashes[$type] : $default; |
68 } | 68 } |
69 | 69 |
70 /** | 70 /** |
76 } | 76 } |
77 | 77 |
78 /** | 78 /** |
79 * {@inheritdoc} | 79 * {@inheritdoc} |
80 */ | 80 */ |
81 public function get($type, array $default = array()) | 81 public function get($type, array $default = []) |
82 { | 82 { |
83 if (!$this->has($type)) { | 83 if (!$this->has($type)) { |
84 return $default; | 84 return $default; |
85 } | 85 } |
86 | 86 |
95 * {@inheritdoc} | 95 * {@inheritdoc} |
96 */ | 96 */ |
97 public function all() | 97 public function all() |
98 { | 98 { |
99 $return = $this->peekAll(); | 99 $return = $this->peekAll(); |
100 $this->flashes = array(); | 100 $this->flashes = []; |
101 | 101 |
102 return $return; | 102 return $return; |
103 } | 103 } |
104 | 104 |
105 /** | 105 /** |