mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Update more code.
This commit is contained in:
@@ -82,17 +82,15 @@ class ActionExpression
|
||||
// 'destination_transaction_id',
|
||||
'notes',
|
||||
];
|
||||
private string $expr;
|
||||
private ExpressionLanguage $expressionLanguage;
|
||||
private bool $isExpression;
|
||||
private ?SyntaxError $validationError;
|
||||
private readonly ExpressionLanguage $expressionLanguage;
|
||||
private readonly bool $isExpression;
|
||||
private readonly ?SyntaxError $validationError;
|
||||
|
||||
public function __construct(string $expr)
|
||||
public function __construct(private readonly string $expr)
|
||||
{
|
||||
$this->expressionLanguage = app(ExpressionLanguage::class);
|
||||
$this->expr = $expr;
|
||||
|
||||
$this->isExpression = self::isExpression($expr);
|
||||
$this->isExpression = self::isExpression($this->expr);
|
||||
$this->validationError = $this->validate();
|
||||
}
|
||||
|
||||
|
@@ -45,16 +45,12 @@ class ActionExpressionLanguageProvider implements ExpressionFunctionProviderInte
|
||||
return [
|
||||
new ExpressionFunction(
|
||||
'constant2',
|
||||
static function ($str): string {
|
||||
return sprintf('(is_string(%1$s) ? strtolower(%1$s) : %1$s)', $str.'!');
|
||||
},
|
||||
static fn($str): string => sprintf('(is_string(%1$s) ? strtolower(%1$s) : %1$s)', $str.'!'),
|
||||
$function
|
||||
),
|
||||
new ExpressionFunction(
|
||||
'constant',
|
||||
static function ($str): string {
|
||||
return sprintf('(is_string(%1$s) ? strtolower(%1$s) : %1$s)', $str.'!');
|
||||
},
|
||||
static fn($str): string => sprintf('(is_string(%1$s) ? strtolower(%1$s) : %1$s)', $str.'!'),
|
||||
$function
|
||||
),
|
||||
|
||||
|
Reference in New Issue
Block a user