Skip to content

Commit 600d481

Browse files
committed
[ExpressionLanguage] added some documentation about functions
1 parent aca1686 commit 600d481

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/Symfony/Component/ExpressionLanguage/ExpressionLanguage.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,18 @@ public function parse($expression, $names)
9292
/**
9393
* Registers a function.
9494
*
95+
* A function is defined by two PHP callables. The callables are used
96+
* by the language to compile and/or evaluate the function.
97+
*
98+
* The first function is used at compilation time and must return a
99+
* PHP representation of the function call (it receives the function
100+
* arguments as arguments).
101+
*
102+
* The second function is used for expression evaluation and must return
103+
* the value of the function call based on the values defined for the
104+
* expression (it receives the values as a first argument and the function
105+
* arguments as remaining arguments).
106+
*
95107
* @param string $name The function name
96108
* @param callable $compiler A callable able to compile the function
97109
* @param callable $evaluator A callable able to evaluate the function

0 commit comments

Comments
 (0)