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 b32f9f2

Browse filesBrowse files
committed
bug #3771 Fix function example in expression language component (raulfraile)
This PR was submitted for the master branch but it was merged into the 2.4 branch instead (closes #3771). Discussion ---------- Fix function example in expression language component The is_string check needs to be part of the runtime code, not of the compilation code, because it needs to check that the argument is a string, not the compiled code to access it (which is always a string as it is source code. cc @stof Commits ------- db710c4 Removed return statement bc673f3 Fix function example in expression language component
2 parents a2ce937 + 235cf33 commit b32f9f2
Copy full SHA for b32f9f2

File tree

Expand file treeCollapse file tree

1 file changed

+1
-5
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+1
-5
lines changed

‎components/expression_language/extending.rst

Copy file name to clipboardExpand all lines: components/expression_language/extending.rst
+1-5Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,7 @@ This method has 3 arguments:
3535
3636
$language = new ExpressionLanguage();
3737
$language->register('lowercase', function ($str) {
38-
if (!is_string($str)) {
39-
return $str;
40-
}
41-
42-
return sprintf('strtolower(%s)', $str);
38+
is_string(%1$s) ? strtolower(%1$s) : %1$s;
4339
}, function ($arguments, $str) {
4440
if (!is_string($str)) {
4541
return $str;

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.