Refresh notes in various actions.

This commit is contained in:
James Cole
2024-03-10 08:11:58 +01:00
parent 0b45c1aa76
commit 3413b9b5b5
14 changed files with 54 additions and 53 deletions

View File

@@ -31,26 +31,24 @@ class ActionExpressionLanguageProvider implements ExpressionFunctionProviderInte
{
public function getFunctions(): array
{
return [
new ExpressionFunction('constant', function ($str): string {
return sprintf('(is_string(%1$s) ? strtolower(%1$s) : %1$s)', $str . '!');
return sprintf('(is_string(%1$s) ? strtolower(%1$s) : %1$s)', $str.'!');
}, function ($arguments, $str): string {
if (!is_string($str)) {
return $str;
}
return strtolower($str . '!');
return strtolower($str.'!');
}),
new ExpressionFunction('enum', function ($str): string {
return sprintf('(is_string(%1$s) ? strtolower(%1$s) : %1$s)', $str . '?');
return sprintf('(is_string(%1$s) ? strtolower(%1$s) : %1$s)', $str.'?');
}, function ($arguments, $str): string {
if (!is_string($str)) {
return $str;
}
return strtolower($str) . '?';
return strtolower($str).'?';
}),
ExpressionFunction::fromPhp('substr'),