Skip to content

Commit

Permalink
[ExpressionLanguage] added some documentation about functions
Browse files Browse the repository at this point in the history
  • Loading branch information
fabpot committed Feb 10, 2014
1 parent aca1686 commit 600d481
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/Symfony/Component/ExpressionLanguage/ExpressionLanguage.php
Expand Up @@ -92,6 +92,18 @@ public function parse($expression, $names)
/**
* Registers a function.
*
* A function is defined by two PHP callables. The callables are used
* by the language to compile and/or evaluate the function.
*
* The first function is used at compilation time and must return a
* PHP representation of the function call (it receives the function
* arguments as arguments).
*
* The second function is used for expression evaluation and must return
* the value of the function call based on the values defined for the
* expression (it receives the values as a first argument and the function
* arguments as remaining arguments).
*
* @param string $name The function name
* @param callable $compiler A callable able to compile the function
* @param callable $evaluator A callable able to evaluate the function
Expand Down

0 comments on commit 600d481

Please sign in to comment.