comparison vendor/symfony/http-foundation/Session/Attribute/AttributeBag.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 class AttributeBag implements AttributeBagInterface, \IteratorAggregate, \Countable 17 class AttributeBag implements AttributeBagInterface, \IteratorAggregate, \Countable
18 { 18 {
19 private $name = 'attributes'; 19 private $name = 'attributes';
20 private $storageKey; 20 private $storageKey;
21 21
22 protected $attributes = array(); 22 protected $attributes = [];
23 23
24 /** 24 /**
25 * @param string $storageKey The key used to store attributes in the session 25 * @param string $storageKey The key used to store attributes in the session
26 */ 26 */
27 public function __construct($storageKey = '_sf2_attributes') 27 public function __construct($storageKey = '_sf2_attributes')
93 /** 93 /**
94 * {@inheritdoc} 94 * {@inheritdoc}
95 */ 95 */
96 public function replace(array $attributes) 96 public function replace(array $attributes)
97 { 97 {
98 $this->attributes = array(); 98 $this->attributes = [];
99 foreach ($attributes as $key => $value) { 99 foreach ($attributes as $key => $value) {
100 $this->set($key, $value); 100 $this->set($key, $value);
101 } 101 }
102 } 102 }
103 103
119 * {@inheritdoc} 119 * {@inheritdoc}
120 */ 120 */
121 public function clear() 121 public function clear()
122 { 122 {
123 $return = $this->attributes; 123 $return = $this->attributes;
124 $this->attributes = array(); 124 $this->attributes = [];
125 125
126 return $return; 126 return $return;
127 } 127 }
128 128
129 /** 129 /**
141 * 141 *
142 * @return int The number of attributes 142 * @return int The number of attributes
143 */ 143 */
144 public function count() 144 public function count()
145 { 145 {
146 return count($this->attributes); 146 return \count($this->attributes);
147 } 147 }
148 } 148 }