updated packages
This commit is contained in:
26
vendor/symfony/http-foundation/HeaderBag.php
vendored
26
vendor/symfony/http-foundation/HeaderBag.php
vendored
@@ -18,13 +18,13 @@ namespace Symfony\Component\HttpFoundation;
|
||||
*/
|
||||
class HeaderBag implements \IteratorAggregate, \Countable
|
||||
{
|
||||
protected $headers = array();
|
||||
protected $cacheControl = array();
|
||||
protected $headers = [];
|
||||
protected $cacheControl = [];
|
||||
|
||||
/**
|
||||
* @param array $headers An array of HTTP headers
|
||||
*/
|
||||
public function __construct(array $headers = array())
|
||||
public function __construct(array $headers = [])
|
||||
{
|
||||
foreach ($headers as $key => $values) {
|
||||
$this->set($key, $values);
|
||||
@@ -80,9 +80,9 @@ class HeaderBag implements \IteratorAggregate, \Countable
|
||||
*
|
||||
* @param array $headers An array of HTTP headers
|
||||
*/
|
||||
public function replace(array $headers = array())
|
||||
public function replace(array $headers = [])
|
||||
{
|
||||
$this->headers = array();
|
||||
$this->headers = [];
|
||||
$this->add($headers);
|
||||
}
|
||||
|
||||
@@ -112,12 +112,12 @@ class HeaderBag implements \IteratorAggregate, \Countable
|
||||
$key = str_replace('_', '-', strtolower($key));
|
||||
$headers = $this->all();
|
||||
|
||||
if (!array_key_exists($key, $headers)) {
|
||||
if (!\array_key_exists($key, $headers)) {
|
||||
if (null === $default) {
|
||||
return $first ? null : array();
|
||||
return $first ? null : [];
|
||||
}
|
||||
|
||||
return $first ? $default : array($default);
|
||||
return $first ? $default : [$default];
|
||||
}
|
||||
|
||||
if ($first) {
|
||||
@@ -148,7 +148,7 @@ class HeaderBag implements \IteratorAggregate, \Countable
|
||||
}
|
||||
} else {
|
||||
if (true === $replace || !isset($this->headers[$key])) {
|
||||
$this->headers[$key] = array($values);
|
||||
$this->headers[$key] = [$values];
|
||||
} else {
|
||||
$this->headers[$key][] = $values;
|
||||
}
|
||||
@@ -168,7 +168,7 @@ class HeaderBag implements \IteratorAggregate, \Countable
|
||||
*/
|
||||
public function has($key)
|
||||
{
|
||||
return array_key_exists(str_replace('_', '-', strtolower($key)), $this->all());
|
||||
return \array_key_exists(str_replace('_', '-', strtolower($key)), $this->all());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -196,7 +196,7 @@ class HeaderBag implements \IteratorAggregate, \Countable
|
||||
unset($this->headers[$key]);
|
||||
|
||||
if ('cache-control' === $key) {
|
||||
$this->cacheControl = array();
|
||||
$this->cacheControl = [];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -245,7 +245,7 @@ class HeaderBag implements \IteratorAggregate, \Countable
|
||||
*/
|
||||
public function hasCacheControlDirective($key)
|
||||
{
|
||||
return array_key_exists($key, $this->cacheControl);
|
||||
return \array_key_exists($key, $this->cacheControl);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -257,7 +257,7 @@ class HeaderBag implements \IteratorAggregate, \Countable
|
||||
*/
|
||||
public function getCacheControlDirective($key)
|
||||
{
|
||||
return array_key_exists($key, $this->cacheControl) ? $this->cacheControl[$key] : null;
|
||||
return \array_key_exists($key, $this->cacheControl) ? $this->cacheControl[$key] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user