8000 minor #33196 [ExpressionLanguage] Add more parameter types (derrabus) · symfony/symfony@63b27f6 · GitHub
[go: up one dir, main page]

Skip to content

Commit 63b27f6

Browse files
minor #33196 [ExpressionLanguage] Add more parameter types (derrabus)
This PR was merged into the 5.0-dev branch. Discussion ---------- [ExpressionLanguage] Add more parameter types | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #32179 | License | MIT | Doc PR | N/A Commits ------- e378a7a [ExpressionLanguage] Add more parameter types.
2 parents 90e3da4 + e378a7a commit 63b27f6

File tree

11 files changed

+13
-13
lines changed

11 files changed

+13
-13
lines changed

src/Symfony/Component/ExpressionLanguage/Compiler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public function __construct(array $functions)
2828
$this->functions = $functions;
2929
}
3030

31-
public function getFunction($name)
31+
public function getFunction(string $name)
3232
{
3333
return $this->functions[$name];
3434
}

src/Symfony/Component/ExpressionLanguage/Node/ArrayNode.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function compile(Compiler $compiler)
4646
$compiler->raw(']');
4747
}
4848

49-
public function evaluate($functions, $values)
49+
public function evaluate(array $functions, array $values)
5050
{
5151
$result = [];
5252
foreach ($this->getKeyValuePairs() as $pair) {

src/Symfony/Component/ExpressionLanguage/Node/BinaryNode.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public function compile(Compiler $compiler)
8484
;
8585
}
8686

87-
public function evaluate($functions, $values)
87+
public function evaluate(array $functions, array $values)
8888
{
8989
$operator = $this->attributes['operator'];
9090
$left = $this->nodes['left']->evaluate($functions, $values);

src/Symfony/Component/ExpressionLanguage/Node/ConditionalNode.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function compile(Compiler $compiler)
4040
;
4141
}
4242

43-
public function evaluate($functions, $values)
43+
public function evaluate(array $functions, array $values)
4444
{
4545
if ($this->nodes['expr1']->evaluate($functions, $values)) {
4646
return $this->nodes['expr2']->evaluate($functions, $values);

src/Symfony/Component/ExpressionLanguage/Node/ConstantNode.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function compile(Compiler $compiler)
3636
$compiler->repr($this->attributes['value']);
3737
}
3838

39-
public function evaluate($functions, $values)
39+
public function evaluate(array $functions, array $values)
4040
{
4141
return $this->attributes['value'];
4242
}

src/Symfony/Component/ExpressionLanguage/Node/FunctionNode.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function compile(Compiler $compiler)
4040
$compiler->raw($function['compiler'](...$arguments));
4141
}
4242

43-
public function evaluate($functions, $values)
43+
public function evaluate(array $functions, array $values)
4444
{
4545
$arguments = [$values];
4646
foreach ($this->nodes['arguments']->nodes as $node) {

src/Symfony/Component/ExpressionLanguage/Node/GetAttrNode.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public function compile(Compiler $compiler)
6464
}
6565
}
6666

67-
public function evaluate($functions, $values)
67+
public function evaluate(array $functions, array $values)
6868
{
6969
switch ($this->attributes['type']) {
7070
case self::PROPERTY_CALL:

src/Symfony/Component/ExpressionLanguage/Node/NameNode.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function compile(Compiler $compiler)
3333
$compiler->raw('$'.$this->attributes['name']);
3434
}
3535

36-
public function evaluate($functions, $values)
36+
public function evaluate(array $functions, array $values)
3737
{
3838
return $values[$this->attributes['name']];
3939
}

src/Symfony/Component/ExpressionLanguage/Node/Node.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public function compile(Compiler $compiler)
6464
}
6565
}
6666

67-
public function evaluate($functions, $values)
67+
public function evaluate(array $functions, array $values)
6868
{
6969
$results = [];
7070
foreach ($this->nodes as $node) {
@@ -90,7 +90,7 @@ public function dump()
9090
return $dump;
9191
}
9292

93-
protected function dumpString($value)
93+
protected function dumpString(string $value)
9494
{
9595
return sprintf('"%s"', addcslashes($value, "\0\t\"\\"));
9696
}

src/Symfony/Component/ExpressionLanguage/Node/UnaryNode.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function compile(Compiler $compiler)
4545
;
4646
}
4747

48-
public function evaluate($functions, $values)
48+
public function evaluate(array $functions, array $values)
4949
{
5050
$value = $this->nodes['node']->evaluate($functions, $values);
5151
switch ($this->attributes['operator']) {

src/Symfony/Component/ExpressionLanguage/Parser.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ protected function getPrimary()
146146
return $this->parsePrimaryExpression();
147147
}
148148

149-
protected function parseConditionalExpression($expr)
149+
protected function parseConditionalExpression(Node\Node $expr)
150150
{
151151
while ($this->stream->current->test(Token::PUNCTUATION_TYPE, '?')) {
152152
$this->stream->next();
@@ -299,7 +299,7 @@ public function parseHashExpression()
299299
return $node;
300300
}
301301

302-
public function parsePostfixExpression($node)
302+
public function parsePostfixExpression(Node\Node $node)
303303
{
304304
$token = $this->stream->current;
305305
while (Token::PUNCTUATION_TYPE == $token->type) {

0 commit comments

Comments
 (0)
0