mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-04-23 16:36:58 +00:00
20 lines
535 B
PHP
20 lines
535 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'];
|
|
foreach ($basicPhpFunctions as $function) {
|
|
$this->addFunction(ExpressionFunction::fromPhp($function));
|
|
}
|
|
}
|
|
}
|