Skip to content
Snippets Groups Projects
Commit c740dc5a authored by Groß-Vogt, Tobias's avatar Groß-Vogt, Tobias
Browse files

array_key_exists function for expressions"

parent 314a2c41
No related branches found
No related tags found
No related merge requests found
Pipeline #232332 failed
...@@ -19,13 +19,6 @@ class ArrayExpressionFunctionProvider implements ExpressionFunctionProviderInter ...@@ -19,13 +19,6 @@ class ArrayExpressionFunctionProvider implements ExpressionFunctionProviderInter
function ($arguments, $varName): bool { function ($arguments, $varName): bool {
return empty($varName); return empty($varName);
}), }),
new ExpressionFunction('array_key_exists',
function (string $keyName, string $arrayName): string {
return sprintf('array_key_exists(%s, %s)', $keyName, $arrayName);
},
function ($arguments, $keyName, $arrayName): bool {
return array_key_exists($keyName, $arrayName);
}),
]; ];
} }
} }
...@@ -15,6 +15,7 @@ class PhpArrayExpressionFunctionProvider implements ExpressionFunctionProviderIn ...@@ -15,6 +15,7 @@ class PhpArrayExpressionFunctionProvider implements ExpressionFunctionProviderIn
ExpressionFunction::fromPhp('count'), ExpressionFunction::fromPhp('count'),
ExpressionFunction::fromPhp('implode'), ExpressionFunction::fromPhp('implode'),
ExpressionFunction::fromPhp('explode'), ExpressionFunction::fromPhp('explode'),
ExpressionFunction::fromPhp('array_key_exists'),
]; ];
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment