Files
firefly-iii/app/TransactionRules/Engine/CustomExpressionLanguage.php
2026-04-12 18:03:07 +02:00

20 lines
581 B
PHP

<?php
declare(strict_types=1);
namespace FireflyIII\TransactionRules\Engine;
use Symfony\Component\ExpressionLanguage\ExpressionFunction;
use Symfony\Component\ExpressionLanguage\ExpressionLanguage;
class CustomExpressionLanguage extends ExpressionLanguage
{
protected function registerFunctions(): void
{
$basicPhpFunctions = ['min', 'max', 'substr', 'strlen', 'strpos','strtolower','strtoupper','ucfirst','ucwords'];
foreach ($basicPhpFunctions as $function) {
$this->addFunction(ExpressionFunction::fromPhp($function));
}
}
}