Mercurial > hg > cmmr2012-drupal-site
comparison vendor/symfony/http-foundation/Session/Attribute/NamespacedAttributeBag.php @ 5:12f9dff5fda9 tip
Update to Drupal core 8.7.1
author | Chris Cannam |
---|---|
date | Thu, 09 May 2019 15:34:47 +0100 |
parents | a9cd425dd02b |
children |
comparison
equal
deleted
inserted
replaced
4:a9cd425dd02b | 5:12f9dff5fda9 |
---|---|
42 | 42 |
43 if (null === $attributes) { | 43 if (null === $attributes) { |
44 return false; | 44 return false; |
45 } | 45 } |
46 | 46 |
47 return array_key_exists($name, $attributes); | 47 return \array_key_exists($name, $attributes); |
48 } | 48 } |
49 | 49 |
50 /** | 50 /** |
51 * {@inheritdoc} | 51 * {@inheritdoc} |
52 */ | 52 */ |
58 | 58 |
59 if (null === $attributes) { | 59 if (null === $attributes) { |
60 return $default; | 60 return $default; |
61 } | 61 } |
62 | 62 |
63 return array_key_exists($name, $attributes) ? $attributes[$name] : $default; | 63 return \array_key_exists($name, $attributes) ? $attributes[$name] : $default; |
64 } | 64 } |
65 | 65 |
66 /** | 66 /** |
67 * {@inheritdoc} | 67 * {@inheritdoc} |
68 */ | 68 */ |
79 public function remove($name) | 79 public function remove($name) |
80 { | 80 { |
81 $retval = null; | 81 $retval = null; |
82 $attributes = &$this->resolveAttributePath($name); | 82 $attributes = &$this->resolveAttributePath($name); |
83 $name = $this->resolveKey($name); | 83 $name = $this->resolveKey($name); |
84 if (null !== $attributes && array_key_exists($name, $attributes)) { | 84 if (null !== $attributes && \array_key_exists($name, $attributes)) { |
85 $retval = $attributes[$name]; | 85 $retval = $attributes[$name]; |
86 unset($attributes[$name]); | 86 unset($attributes[$name]); |
87 } | 87 } |
88 | 88 |
89 return $retval; | 89 return $retval; |
121 } | 121 } |
122 | 122 |
123 unset($parts[\count($parts) - 1]); | 123 unset($parts[\count($parts) - 1]); |
124 | 124 |
125 foreach ($parts as $part) { | 125 foreach ($parts as $part) { |
126 if (null !== $array && !array_key_exists($part, $array)) { | 126 if (null !== $array && !\array_key_exists($part, $array)) { |
127 if (!$writeContext) { | 127 if (!$writeContext) { |
128 $null = null; | 128 $null = null; |
129 | 129 |
130 return $null; | 130 return $null; |
131 } | 131 } |