summaryrefslogtreecommitdiff
path: root/vendor/symfony/expression-language/Node/ArrayNode.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/symfony/expression-language/Node/ArrayNode.php')
-rw-r--r--vendor/symfony/expression-language/Node/ArrayNode.php14
1 files changed, 7 insertions, 7 deletions
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;