do not instanciate an own EelEvaluator but use the DI for that
All checks were successful
ci/woodpecker/push/code-style Pipeline was successful
ci/woodpecker/push/functional-tests/1 Pipeline was successful
ci/woodpecker/push/functional-tests/2 Pipeline was successful

This commit is contained in:
Ferdinand Kuhl 2024-07-25 17:47:48 +02:00
parent a5ccfef84b
commit cc61eca083

View file

@ -4,8 +4,8 @@ declare(strict_types=1);
namespace DigiComp\AttachmentViewUtility;
use Neos\Eel\CompilingEvaluator;
use Neos\Eel\Context;
use Neos\Eel\EelEvaluatorInterface;
use Neos\Eel\Helper\ArrayHelper;
use Neos\Eel\Helper\StringHelper;
use Neos\Flow\Annotations as Flow;
@ -17,6 +17,9 @@ trait EelFilenameTrait
{
protected string $eelExpressionOptionKey = 'filenameEelExpression';
#[Flow\Inject(name: EelEvaluatorInterface::class, lazy: false)]
protected EelEvaluatorInterface $eelEvaluator;
protected function addOptionFilenameEelExpression(): void
{
if (\property_exists($this, 'supportedOptions')) {
@ -59,7 +62,7 @@ trait EelFilenameTrait
'Translation' => new TranslationHelper(),
]));
$this->emitFilenameEelExpressionContext($context);
return (new CompilingEvaluator())->evaluate($expression, $context);
return $this->eelEvaluator->evaluate($expression, $context);
}
/**