do not instanciate an own EelEvaluator but use the DI for that
This commit is contained in:
parent
a5ccfef84b
commit
cc61eca083
1 changed files with 5 additions and 2 deletions
|
@ -4,8 +4,8 @@ declare(strict_types=1);
|
||||||
|
|
||||||
namespace DigiComp\AttachmentViewUtility;
|
namespace DigiComp\AttachmentViewUtility;
|
||||||
|
|
||||||
use Neos\Eel\CompilingEvaluator;
|
|
||||||
use Neos\Eel\Context;
|
use Neos\Eel\Context;
|
||||||
|
use Neos\Eel\EelEvaluatorInterface;
|
||||||
use Neos\Eel\Helper\ArrayHelper;
|
use Neos\Eel\Helper\ArrayHelper;
|
||||||
use Neos\Eel\Helper\StringHelper;
|
use Neos\Eel\Helper\StringHelper;
|
||||||
use Neos\Flow\Annotations as Flow;
|
use Neos\Flow\Annotations as Flow;
|
||||||
|
@ -17,6 +17,9 @@ trait EelFilenameTrait
|
||||||
{
|
{
|
||||||
protected string $eelExpressionOptionKey = 'filenameEelExpression';
|
protected string $eelExpressionOptionKey = 'filenameEelExpression';
|
||||||
|
|
||||||
|
#[Flow\Inject(name: EelEvaluatorInterface::class, lazy: false)]
|
||||||
|
protected EelEvaluatorInterface $eelEvaluator;
|
||||||
|
|
||||||
protected function addOptionFilenameEelExpression(): void
|
protected function addOptionFilenameEelExpression(): void
|
||||||
{
|
{
|
||||||
if (\property_exists($this, 'supportedOptions')) {
|
if (\property_exists($this, 'supportedOptions')) {
|
||||||
|
@ -59,7 +62,7 @@ trait EelFilenameTrait
|
||||||
'Translation' => new TranslationHelper(),
|
'Translation' => new TranslationHelper(),
|
||||||
]));
|
]));
|
||||||
$this->emitFilenameEelExpressionContext($context);
|
$this->emitFilenameEelExpressionContext($context);
|
||||||
return (new CompilingEvaluator())->evaluate($expression, $context);
|
return $this->eelEvaluator->evaluate($expression, $context);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Reference in a new issue