Ferdinand Kuhl
050e6e119f
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
ci/woodpecker/push/functional-tests/3 Pipeline was successful
ci/woodpecker/push/functional-tests/4 Pipeline was successful
26 lines
885 B
PHP
26 lines
885 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace DigiComp\FluidRenderFunctions\ViewHelpers\Traits;
|
|
|
|
use DigiComp\FluidRenderFunctions\InvokeRenderFunctionInterface;
|
|
use DigiComp\FluidRenderFunctions\ViewHelpers\RegisterRenderFunctionViewHelper;
|
|
|
|
trait ValidateRenderFunctionTrait
|
|
{
|
|
public function validateRenderFunctionArgument(string $argumentName)
|
|
{
|
|
$renderFunction = $this->viewHelperVariableContainer->get(
|
|
RegisterRenderFunctionViewHelper::class,
|
|
$this->arguments[$argumentName]
|
|
);
|
|
if (!($renderFunction instanceof InvokeRenderFunctionInterface)) {
|
|
throw new \InvalidArgumentException(
|
|
'render function with name "' . $this->arguments[$argumentName] . '" has not been registered.',
|
|
1717293038
|
|
);
|
|
}
|
|
$this->arguments[$argumentName] = $renderFunction;
|
|
}
|
|
}
|