Skip to content

Commit 74631d4

Browse files
committed
fixed CS in ExpressionLanguage fixtures
1 parent 1fce830 commit 74631d4

File tree

6 files changed

+11
-11
lines changed

6 files changed

+11
-11
lines changed

Compiler.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ public function repr($value)
125125
} elseif (\is_bool($value)) {
126126
$this->raw($value ? 'true' : 'false');
127127
} elseif (\is_array($value)) {
128-
$this->raw('array(');
128+
$this->raw('[');
129129
$first = true;
130130
foreach ($value as $key => $value) {
131131
if (!$first) {
@@ -136,7 +136,7 @@ public function repr($value)
136136
$this->raw(' => ');
137137
$this->repr($value);
138138
}
139-
$this->raw(')');
139+
$this->raw(']');
140140
} else {
141141
$this->string($value);
142142
}

Node/ArrayNode.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ public function addElement(Node $value, Node $key = null)
4141
*/
4242
public function compile(Compiler $compiler)
4343
{
44-
$compiler->raw('array(');
44+
$compiler->raw('[');
4545
$this->compileArguments($compiler);
46-
$compiler->raw(')');
46+
$compiler->raw(']');
4747
}
4848

4949
public function evaluate($functions, $values)

Tests/Node/ArrayNodeTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function getEvaluateData()
3838
public function getCompileData()
3939
{
4040
return [
41-
['array("b" => "a", 0 => "b")', $this->getArrayNode()],
41+
['["b" => "a", 0 => "b"]', $this->getArrayNode()],
4242
];
4343
}
4444

Tests/Node/BinaryNodeTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,10 @@ public function getCompileData()
104104
['pow(5, 2)', new BinaryNode('**', new ConstantNode(5), new ConstantNode(2))],
105105
['("a" . "b")', new BinaryNode('~', new ConstantNode('a'), new ConstantNode('b'))],
106106

107-
['in_array("a", array(0 => "a", 1 => "b"))', new BinaryNode('in', new ConstantNode('a'), $array)],
108-
['in_array("c", array(0 => "a", 1 => "b"))', new BinaryNode('in', new ConstantNode('c'), $array)],
109-
['!in_array("c", array(0 => "a", 1 => "b"))', new BinaryNode('not in', new ConstantNode('c'), $array)],
110-
['!in_array("a", array(0 => "a", 1 => "b"))', new BinaryNode('not in', new ConstantNode('a'), $array)],
107+
['in_array("a", [0 => "a", 1 => "b"])', new BinaryNode('in', new ConstantNode('a'), $array)],
108+
['in_array("c", [0 => "a", 1 => "b"])', new BinaryNode('in', new ConstantNode('c'), $array)],
109+
['!in_array("c", [0 => "a", 1 => "b"])', new BinaryNode('not in', new ConstantNode('c'), $array)],
110+
['!in_array("a", [0 => "a", 1 => "b"])', new BinaryNode('not in', new ConstantNode('a'), $array)],
111111

112112
['range(1, 3)', new BinaryNode('..', new ConstantNode(1), new ConstantNode(3))],
113113

Tests/Node/ConstantNodeTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function getCompileData()
3737
['3', new ConstantNode(3)],
3838
['3.3', new ConstantNode(3.3)],
3939
['"foo"', new ConstantNode('foo')],
40-
['array(0 => 1, "b" => "a")', new ConstantNode([1, 'b' => 'a'])],
40+
['[0 => 1, "b" => "a"]', new ConstantNode([1, 'b' => 'a'])],
4141
];
4242
}
4343

Tests/Node/GetAttrNodeTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function getCompileData()
3939

4040
['$foo->foo', new GetAttrNode(new NameNode('foo'), new ConstantNode('foo'), $this->getArrayNode(), GetAttrNode::PROPERTY_CALL), ['foo' => new Obj()]],
4141

42-
['$foo->foo(array("b" => "a", 0 => "b"))', new GetAttrNode(new NameNode('foo'), new ConstantNode('foo'), $this->getArrayNode(), GetAttrNode::METHOD_CALL), ['foo' => new Obj()]],
42+
['$foo->foo(["b" => "a", 0 => "b"])', new GetAttrNode(new NameNode('foo'), new ConstantNode('foo'), $this->getArrayNode(), GetAttrNode::METHOD_CALL), ['foo' => new Obj()]],
4343
['$foo[$index]', new GetAttrNode(new NameNode('foo'), new NameNode('index'), $this->getArrayNode(), GetAttrNode::ARRAY_CALL)],
4444
];
4545
}

0 commit comments

Comments
 (0)