File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
components/expression_language Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ This method has 3 arguments:
3434 use Symfony\Component\ExpressionLanguage\ExpressionLanguage;
3535
3636 $expressionLanguage = new ExpressionLanguage();
37- $expressionLanguage->register('lowercase', function ($arguments, $ str) {
37+ $expressionLanguage->register('lowercase', function ($str) {
3838 return sprintf('(is_string(%1$s) ? strtolower(%1$s) : %1$s)', $str);
3939 }, function ($arguments, $str) {
4040 if (!is_string($str)) {
@@ -45,11 +45,11 @@ This method has 3 arguments:
4545 });
4646
4747 var_dump($expressionLanguage->evaluate('lowercase("HELLO")'));
48+ // this will print: hello
4849
49- This will print ``hello ``. Both the **compiler ** and **evaluator ** are passed
50- an ``arguments `` variable as their first argument, which is equal to the
51- second argument to ``evaluate() `` or ``compile() `` (e.g. the "values" when
52- evaluating or the "names" if compiling).
50+ In addition to the custom function arguments, the **evaluator ** is passed an
51+ ``arguments `` variable as its first argument, which is equal to the second
52+ argument of ``compile() `` (e.g. the "values" when evaluating an expression).
5353
5454.. _components-expression-language-provider :
5555
You can’t perform that action at this time.
0 commit comments