updated backend

This commit is contained in:
Torsten 2020-01-17 10:58:01 +01:00
parent 1fea0f4fe7
commit 11521c2339
3459 changed files with 72735 additions and 168535 deletions

View file

@ -23,10 +23,7 @@ class ParameterBag implements \IteratorAggregate, \Countable
*/
protected $parameters;
/**
* @param array $parameters An array of parameters
*/
public function __construct(array $parameters = array())
public function __construct(array $parameters = [])
{
$this->parameters = $parameters;
}
@ -53,20 +50,16 @@ class ParameterBag implements \IteratorAggregate, \Countable
/**
* Replaces the current parameters by a new set.
*
* @param array $parameters An array of parameters
*/
public function replace(array $parameters = array())
public function replace(array $parameters = [])
{
$this->parameters = $parameters;
}
/**
* Adds parameters.
*
* @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 +74,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 +97,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 +147,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));
}
/**
@ -174,7 +167,7 @@ class ParameterBag implements \IteratorAggregate, \Countable
* Returns the parameter value converted to boolean.
*
* @param string $key The parameter key
* @param mixed $default The default value if the parameter key does not exist
* @param bool $default The default value if the parameter key does not exist
*
* @return bool The filtered value
*/
@ -191,17 +184,17 @@ class ParameterBag implements \IteratorAggregate, \Countable
* @param int $filter FILTER_* constant
* @param mixed $options Filter options
*
* @see http://php.net/manual/en/function.filter-var.php
* @see https://php.net/filter-var
*
* @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.