updated packages
This commit is contained in:
16
vendor/symfony/http-foundation/ParameterBag.php
vendored
16
vendor/symfony/http-foundation/ParameterBag.php
vendored
@@ -26,7 +26,7 @@ class ParameterBag implements \IteratorAggregate, \Countable
|
||||
/**
|
||||
* @param array $parameters An array of parameters
|
||||
*/
|
||||
public function __construct(array $parameters = array())
|
||||
public function __construct(array $parameters = [])
|
||||
{
|
||||
$this->parameters = $parameters;
|
||||
}
|
||||
@@ -56,7 +56,7 @@ class ParameterBag implements \IteratorAggregate, \Countable
|
||||
*
|
||||
* @param array $parameters An array of parameters
|
||||
*/
|
||||
public function replace(array $parameters = array())
|
||||
public function replace(array $parameters = [])
|
||||
{
|
||||
$this->parameters = $parameters;
|
||||
}
|
||||
@@ -66,7 +66,7 @@ class ParameterBag implements \IteratorAggregate, \Countable
|
||||
*
|
||||
* @param array $parameters An array of parameters
|
||||
*/
|
||||
public function add(array $parameters = array())
|
||||
public function add(array $parameters = [])
|
||||
{
|
||||
$this->parameters = array_replace($this->parameters, $parameters);
|
||||
}
|
||||
@@ -81,7 +81,7 @@ class ParameterBag implements \IteratorAggregate, \Countable
|
||||
*/
|
||||
public function get($key, $default = null)
|
||||
{
|
||||
return array_key_exists($key, $this->parameters) ? $this->parameters[$key] : $default;
|
||||
return \array_key_exists($key, $this->parameters) ? $this->parameters[$key] : $default;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -104,7 +104,7 @@ class ParameterBag implements \IteratorAggregate, \Countable
|
||||
*/
|
||||
public function has($key)
|
||||
{
|
||||
return array_key_exists($key, $this->parameters);
|
||||
return \array_key_exists($key, $this->parameters);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -154,7 +154,7 @@ class ParameterBag implements \IteratorAggregate, \Countable
|
||||
public function getDigits($key, $default = '')
|
||||
{
|
||||
// we need to remove - and + because they're allowed in the filter
|
||||
return str_replace(array('-', '+'), '', $this->filter($key, $default, FILTER_SANITIZE_NUMBER_INT));
|
||||
return str_replace(['-', '+'], '', $this->filter($key, $default, FILTER_SANITIZE_NUMBER_INT));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -195,13 +195,13 @@ class ParameterBag implements \IteratorAggregate, \Countable
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function filter($key, $default = null, $filter = FILTER_DEFAULT, $options = array())
|
||||
public function filter($key, $default = null, $filter = FILTER_DEFAULT, $options = [])
|
||||
{
|
||||
$value = $this->get($key, $default);
|
||||
|
||||
// Always turn $options into an array - this allows filter_var option shortcuts.
|
||||
if (!\is_array($options) && $options) {
|
||||
$options = array('flags' => $options);
|
||||
$options = ['flags' => $options];
|
||||
}
|
||||
|
||||
// Add a convenience check for arrays.
|
||||
|
||||
Reference in New Issue
Block a user