Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 4ab78e0

Browse filesBrowse files
committed
minor #10222 [ExpressionLanguage] added some documentation about functions (fabpot)
This PR was merged into the 2.4 branch. Discussion ---------- [ExpressionLanguage] added some documentation about functions | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #10216 | License | MIT | Doc PR | n/a This adds documentation about how to define a function in the expression language. Commits ------- 600d481 [ExpressionLanguage] added some documentation about functions
2 parents 41cf1cc + 600d481 commit 4ab78e0
Copy full SHA for 4ab78e0

File tree

Expand file treeCollapse file tree

1 file changed

+12
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+12
-0
lines changed

‎src/Symfony/Component/ExpressionLanguage/ExpressionLanguage.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/ExpressionLanguage/ExpressionLanguage.php
+12Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.