86 lines
2.8 KiB
YAML
86 lines
2.8 KiB
YAML
name: ExpressionFunction
|
|
class_comment: '# * Represents a function that can be used in an expression.
|
|
|
|
# *
|
|
|
|
# * A function is defined by two PHP callables. The callables are used
|
|
|
|
# * by the language to compile and/or evaluate the function.
|
|
|
|
# *
|
|
|
|
# * The "compiler" function is used at compilation time and must return a
|
|
|
|
# * PHP representation of the function call (it receives the function
|
|
|
|
# * arguments as arguments).
|
|
|
|
# *
|
|
|
|
# * The "evaluator" 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).
|
|
|
|
# *
|
|
|
|
# * @author Fabien Potencier <fabien@symfony.com>'
|
|
dependencies: []
|
|
properties: []
|
|
methods:
|
|
- name: __construct
|
|
visibility: public
|
|
parameters:
|
|
- name: name
|
|
- name: compiler
|
|
- name: evaluator
|
|
comment: "# * Represents a function that can be used in an expression.\n# *\n# *\
|
|
\ A function is defined by two PHP callables. The callables are used\n# * by the\
|
|
\ language to compile and/or evaluate the function.\n# *\n# * The \"compiler\"\
|
|
\ function is used at compilation time and must return a\n# * PHP representation\
|
|
\ of the function call (it receives the function\n# * arguments as arguments).\n\
|
|
# *\n# * The \"evaluator\" function is used for expression evaluation and must\
|
|
\ return\n# * the value of the function call based on the values defined for the\n\
|
|
# * expression (it receives the values as a first argument and the function\n\
|
|
# * arguments as remaining arguments).\n# *\n# * @author Fabien Potencier <fabien@symfony.com>\n\
|
|
# */\n# class ExpressionFunction\n# {\n# private \\Closure $compiler;\n# private\
|
|
\ \\Closure $evaluator;\n# \n# /**\n# * @param string $name The function\
|
|
\ name\n# * @param callable $compiler A callable able to compile the function\n\
|
|
# * @param callable $evaluator A callable able to evaluate the function"
|
|
- name: getName
|
|
visibility: public
|
|
parameters: []
|
|
comment: null
|
|
- name: getCompiler
|
|
visibility: public
|
|
parameters: []
|
|
comment: null
|
|
- name: getEvaluator
|
|
visibility: public
|
|
parameters: []
|
|
comment: null
|
|
- name: fromPhp
|
|
visibility: public
|
|
parameters:
|
|
- name: phpFunctionName
|
|
- name: expressionFunctionName
|
|
default: 'null'
|
|
comment: '# * Creates an ExpressionFunction from a PHP function name.
|
|
|
|
# *
|
|
|
|
# * @param string|null $expressionFunctionName The expression function name (default:
|
|
same than the PHP function name)
|
|
|
|
# *
|
|
|
|
# * @throws \InvalidArgumentException if given PHP function name does not exist
|
|
|
|
# * @throws \InvalidArgumentException if given PHP function name is in namespace
|
|
|
|
# * and expression function name is not defined'
|
|
traits: []
|
|
interfaces: []
|