diff options
Diffstat (limited to 'vendor/symfony/expression-language/Node')
10 files changed, 45 insertions, 45 deletions
diff --git a/vendor/symfony/expression-language/Node/ArgumentsNode.php b/vendor/symfony/expression-language/Node/ArgumentsNode.php index 1c78d8054b..e9849a448a 100644 --- a/vendor/symfony/expression-language/Node/ArgumentsNode.php +++ b/vendor/symfony/expression-language/Node/ArgumentsNode.php @@ -27,7 +27,7 @@ class ArgumentsNode extends ArrayNode public function toArray() { - $array = array(); + $array = []; foreach ($this->getKeyValuePairs() as $pair) { $array[] = $pair['value']; diff --git a/vendor/symfony/expression-language/Node/ArrayNode.php b/vendor/symfony/expression-language/Node/ArrayNode.php index e1a2f2e904..921319a744 100644 --- a/vendor/symfony/expression-language/Node/ArrayNode.php +++ b/vendor/symfony/expression-language/Node/ArrayNode.php @@ -41,14 +41,14 @@ class ArrayNode extends Node */ public function compile(Compiler $compiler) { - $compiler->raw('array('); + $compiler->raw('['); $this->compileArguments($compiler); - $compiler->raw(')'); + $compiler->raw(']'); } public function evaluate($functions, $values) { - $result = array(); + $result = []; foreach ($this->getKeyValuePairs() as $pair) { $result[$pair['key']->evaluate($functions, $values)] = $pair['value']->evaluate($functions, $values); } @@ -58,12 +58,12 @@ class ArrayNode extends Node public function toArray() { - $value = array(); + $value = []; foreach ($this->getKeyValuePairs() as $pair) { $value[$pair['key']->attributes['value']] = $pair['value']; } - $array = array(); + $array = []; if ($this->isHash($value)) { foreach ($value as $k => $v) { @@ -88,9 +88,9 @@ class ArrayNode extends Node protected function getKeyValuePairs() { - $pairs = array(); + $pairs = []; foreach (array_chunk($this->nodes, 2) as $pair) { - $pairs[] = array('key' => $pair[0], 'value' => $pair[1]); + $pairs[] = ['key' => $pair[0], 'value' => $pair[1]]; } return $pairs; diff --git a/vendor/symfony/expression-language/Node/BinaryNode.php b/vendor/symfony/expression-language/Node/BinaryNode.php index 48c6548fa8..0af4f16623 100644 --- a/vendor/symfony/expression-language/Node/BinaryNode.php +++ b/vendor/symfony/expression-language/Node/BinaryNode.php @@ -20,24 +20,24 @@ use Symfony\Component\ExpressionLanguage\Compiler; */ class BinaryNode extends Node { - private static $operators = array( + private static $operators = [ '~' => '.', 'and' => '&&', 'or' => '||', - ); + ]; - private static $functions = array( + private static $functions = [ '**' => 'pow', '..' => 'range', 'in' => 'in_array', 'not in' => '!in_array', - ); + ]; public function __construct(string $operator, Node $left, Node $right) { parent::__construct( - array('left' => $left, 'right' => $right), - array('operator' => $operator) + ['left' => $left, 'right' => $right], + ['operator' => $operator] ); } @@ -157,6 +157,6 @@ class BinaryNode extends Node public function toArray() { - return array('(', $this->nodes['left'], ' '.$this->attributes['operator'].' ', $this->nodes['right'], ')'); + return ['(', $this->nodes['left'], ' '.$this->attributes['operator'].' ', $this->nodes['right'], ')']; } } diff --git a/vendor/symfony/expression-language/Node/ConditionalNode.php b/vendor/symfony/expression-language/Node/ConditionalNode.php index 9db0f931aa..ca1b484bc0 100644 --- a/vendor/symfony/expression-language/Node/ConditionalNode.php +++ b/vendor/symfony/expression-language/Node/ConditionalNode.php @@ -23,7 +23,7 @@ class ConditionalNode extends Node public function __construct(Node $expr1, Node $expr2, Node $expr3) { parent::__construct( - array('expr1' => $expr1, 'expr2' => $expr2, 'expr3' => $expr3) + ['expr1' => $expr1, 'expr2' => $expr2, 'expr3' => $expr3] ); } @@ -51,6 +51,6 @@ class ConditionalNode extends Node public function toArray() { - return array('(', $this->nodes['expr1'], ' ? ', $this->nodes['expr2'], ' : ', $this->nodes['expr3'], ')'); + return ['(', $this->nodes['expr1'], ' ? ', $this->nodes['expr2'], ' : ', $this->nodes['expr3'], ')']; } } diff --git a/vendor/symfony/expression-language/Node/ConstantNode.php b/vendor/symfony/expression-language/Node/ConstantNode.php index de2c48f10d..0353f78510 100644 --- a/vendor/symfony/expression-language/Node/ConstantNode.php +++ b/vendor/symfony/expression-language/Node/ConstantNode.php @@ -26,8 +26,8 @@ class ConstantNode extends Node { $this->isIdentifier = $isIdentifier; parent::__construct( - array(), - array('value' => $value) + [], + ['value' => $value] ); } @@ -43,7 +43,7 @@ class ConstantNode extends Node public function toArray() { - $array = array(); + $array = []; $value = $this->attributes['value']; if ($this->isIdentifier) { diff --git a/vendor/symfony/expression-language/Node/FunctionNode.php b/vendor/symfony/expression-language/Node/FunctionNode.php index fd24e1300f..2a46191061 100644 --- a/vendor/symfony/expression-language/Node/FunctionNode.php +++ b/vendor/symfony/expression-language/Node/FunctionNode.php @@ -23,14 +23,14 @@ class FunctionNode extends Node public function __construct(string $name, Node $arguments) { parent::__construct( - array('arguments' => $arguments), - array('name' => $name) + ['arguments' => $arguments], + ['name' => $name] ); } public function compile(Compiler $compiler) { - $arguments = array(); + $arguments = []; foreach ($this->nodes['arguments']->nodes as $node) { $arguments[] = $compiler->subcompile($node); } @@ -42,7 +42,7 @@ class FunctionNode extends Node public function evaluate($functions, $values) { - $arguments = array($values); + $arguments = [$values]; foreach ($this->nodes['arguments']->nodes as $node) { $arguments[] = $node->evaluate($functions, $values); } @@ -52,7 +52,7 @@ class FunctionNode extends Node public function toArray() { - $array = array(); + $array = []; $array[] = $this->attributes['name']; foreach ($this->nodes['arguments']->nodes as $node) { diff --git a/vendor/symfony/expression-language/Node/GetAttrNode.php b/vendor/symfony/expression-language/Node/GetAttrNode.php index 86c5a405f0..a28b596113 100644 --- a/vendor/symfony/expression-language/Node/GetAttrNode.php +++ b/vendor/symfony/expression-language/Node/GetAttrNode.php @@ -27,8 +27,8 @@ class GetAttrNode extends Node public function __construct(Node $node, Node $attribute, ArrayNode $arguments, int $type) { parent::__construct( - array('node' => $node, 'attribute' => $attribute, 'arguments' => $arguments), - array('type' => $type) + ['node' => $node, 'attribute' => $attribute, 'arguments' => $arguments], + ['type' => $type] ); } @@ -82,7 +82,7 @@ class GetAttrNode extends Node if (!\is_object($obj)) { throw new \RuntimeException('Unable to get a property on a non-object.'); } - if (!\is_callable($toCall = array($obj, $this->nodes['attribute']->attributes['value']))) { + if (!\is_callable($toCall = [$obj, $this->nodes['attribute']->attributes['value']])) { throw new \RuntimeException(sprintf('Unable to call method "%s" of object "%s".', $this->nodes['attribute']->attributes['value'], \get_class($obj))); } @@ -102,13 +102,13 @@ class GetAttrNode extends Node { switch ($this->attributes['type']) { case self::PROPERTY_CALL: - return array($this->nodes['node'], '.', $this->nodes['attribute']); + return [$this->nodes['node'], '.', $this->nodes['attribute']]; case self::METHOD_CALL: - return array($this->nodes['node'], '.', $this->nodes['attribute'], '(', $this->nodes['arguments'], ')'); + return [$this->nodes['node'], '.', $this->nodes['attribute'], '(', $this->nodes['arguments'], ')']; case self::ARRAY_CALL: - return array($this->nodes['node'], '[', $this->nodes['attribute'], ']'); + return [$this->nodes['node'], '[', $this->nodes['attribute'], ']']; } } } diff --git a/vendor/symfony/expression-language/Node/NameNode.php b/vendor/symfony/expression-language/Node/NameNode.php index c084bd4793..1a3d994148 100644 --- a/vendor/symfony/expression-language/Node/NameNode.php +++ b/vendor/symfony/expression-language/Node/NameNode.php @@ -23,8 +23,8 @@ class NameNode extends Node public function __construct(string $name) { parent::__construct( - array(), - array('name' => $name) + [], + ['name' => $name] ); } @@ -40,6 +40,6 @@ class NameNode extends Node public function toArray() { - return array($this->attributes['name']); + return [$this->attributes['name']]; } } diff --git a/vendor/symfony/expression-language/Node/Node.php b/vendor/symfony/expression-language/Node/Node.php index c6eb9f0351..7923cb1d64 100644 --- a/vendor/symfony/expression-language/Node/Node.php +++ b/vendor/symfony/expression-language/Node/Node.php @@ -20,14 +20,14 @@ use Symfony\Component\ExpressionLanguage\Compiler; */ class Node { - public $nodes = array(); - public $attributes = array(); + public $nodes = []; + public $attributes = []; /** * @param array $nodes An array of nodes * @param array $attributes An array of attributes */ - public function __construct(array $nodes = array(), array $attributes = array()) + public function __construct(array $nodes = [], array $attributes = []) { $this->nodes = $nodes; $this->attributes = $attributes; @@ -35,12 +35,12 @@ class Node public function __toString() { - $attributes = array(); + $attributes = []; foreach ($this->attributes as $name => $value) { $attributes[] = sprintf('%s: %s', $name, str_replace("\n", '', var_export($value, true))); } - $repr = array(str_replace('Symfony\Component\ExpressionLanguage\Node\\', '', \get_class($this)).'('.implode(', ', $attributes)); + $repr = [str_replace('Symfony\Component\ExpressionLanguage\Node\\', '', \get_class($this)).'('.implode(', ', $attributes)]; if (\count($this->nodes)) { foreach ($this->nodes as $node) { @@ -66,7 +66,7 @@ class Node public function evaluate($functions, $values) { - $results = array(); + $results = []; foreach ($this->nodes as $node) { $results[] = $node->evaluate($functions, $values); } diff --git a/vendor/symfony/expression-language/Node/UnaryNode.php b/vendor/symfony/expression-language/Node/UnaryNode.php index 4a18e83a5d..abf2cc6bac 100644 --- a/vendor/symfony/expression-language/Node/UnaryNode.php +++ b/vendor/symfony/expression-language/Node/UnaryNode.php @@ -20,18 +20,18 @@ use Symfony\Component\ExpressionLanguage\Compiler; */ class UnaryNode extends Node { - private static $operators = array( + private static $operators = [ '!' => '!', 'not' => '!', '+' => '+', '-' => '-', - ); + ]; public function __construct(string $operator, Node $node) { parent::__construct( - array('node' => $node), - array('operator' => $operator) + ['node' => $node], + ['operator' => $operator] ); } @@ -61,6 +61,6 @@ class UnaryNode extends Node public function toArray(): array { - return array('(', $this->attributes['operator'].' ', $this->nodes['node'], ')'); + return ['(', $this->attributes['operator'].' ', $this->nodes['node'], ')']; } } |
