mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-06-10 20:31:26 +00:00
18 lines
506 B
PHP
18 lines
506 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
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));
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|