Mercurial > hg > isophonics-drupal-site
comparison vendor/symfony/http-foundation/HeaderBag.php @ 18:af1871eacc83
Update to Drupal core 8.7.1
author | Chris Cannam |
---|---|
date | Thu, 09 May 2019 15:33:08 +0100 |
parents | 129ea1e6d783 |
children |
comparison
equal
deleted
inserted
replaced
17:129ea1e6d783 | 18:af1871eacc83 |
---|---|
110 public function get($key, $default = null, $first = true) | 110 public function get($key, $default = null, $first = true) |
111 { | 111 { |
112 $key = str_replace('_', '-', strtolower($key)); | 112 $key = str_replace('_', '-', strtolower($key)); |
113 $headers = $this->all(); | 113 $headers = $this->all(); |
114 | 114 |
115 if (!array_key_exists($key, $headers)) { | 115 if (!\array_key_exists($key, $headers)) { |
116 if (null === $default) { | 116 if (null === $default) { |
117 return $first ? null : []; | 117 return $first ? null : []; |
118 } | 118 } |
119 | 119 |
120 return $first ? $default : [$default]; | 120 return $first ? $default : [$default]; |
166 * | 166 * |
167 * @return bool true if the parameter exists, false otherwise | 167 * @return bool true if the parameter exists, false otherwise |
168 */ | 168 */ |
169 public function has($key) | 169 public function has($key) |
170 { | 170 { |
171 return array_key_exists(str_replace('_', '-', strtolower($key)), $this->all()); | 171 return \array_key_exists(str_replace('_', '-', strtolower($key)), $this->all()); |
172 } | 172 } |
173 | 173 |
174 /** | 174 /** |
175 * Returns true if the given HTTP header contains the given value. | 175 * Returns true if the given HTTP header contains the given value. |
176 * | 176 * |
243 * | 243 * |
244 * @return bool true if the directive exists, false otherwise | 244 * @return bool true if the directive exists, false otherwise |
245 */ | 245 */ |
246 public function hasCacheControlDirective($key) | 246 public function hasCacheControlDirective($key) |
247 { | 247 { |
248 return array_key_exists($key, $this->cacheControl); | 248 return \array_key_exists($key, $this->cacheControl); |
249 } | 249 } |
250 | 250 |
251 /** | 251 /** |
252 * Returns a Cache-Control directive value by name. | 252 * Returns a Cache-Control directive value by name. |
253 * | 253 * |
255 * | 255 * |
256 * @return mixed|null The directive value if defined, null otherwise | 256 * @return mixed|null The directive value if defined, null otherwise |
257 */ | 257 */ |
258 public function getCacheControlDirective($key) | 258 public function getCacheControlDirective($key) |
259 { | 259 { |
260 return array_key_exists($key, $this->cacheControl) ? $this->cacheControl[$key] : null; | 260 return \array_key_exists($key, $this->cacheControl) ? $this->cacheControl[$key] : null; |
261 } | 261 } |
262 | 262 |
263 /** | 263 /** |
264 * Removes a Cache-Control directive. | 264 * Removes a Cache-Control directive. |
265 * | 265 * |