|
@ -4,7 +4,6 @@ declare(strict_types=1); |
|
|
|
|
|
|
|
|
namespace App\Engine; |
|
|
namespace App\Engine; |
|
|
|
|
|
|
|
|
use App\Dom\Document; |
|
|
|
|
|
use App\Dom\Node; |
|
|
use App\Dom\Node; |
|
|
use App\Dom\NodeValue; |
|
|
use App\Dom\NodeValue; |
|
|
use App\Dom\NodeFunction; |
|
|
use App\Dom\NodeFunction; |
|
@ -105,6 +104,10 @@ class CfnppFunctions |
|
|
*/ |
|
|
*/ |
|
|
public function f_var(Node $node, NodeFunction $function): ?Node |
|
|
public function f_var(Node $node, NodeFunction $function): ?Node |
|
|
{ |
|
|
{ |
|
|
|
|
|
if (!($function instanceof NodeFunctionValue)) |
|
|
|
|
|
{ |
|
|
|
|
|
throw new \Exception('!var requires scalar argument'); |
|
|
|
|
|
} |
|
|
$value = $this->options->getVariable($function->getValue()); |
|
|
$value = $this->options->getVariable($function->getValue()); |
|
|
return new NodeValue(null, $node->hasName() ? $node->getName() : null, $value); |
|
|
return new NodeValue(null, $node->hasName() ? $node->getName() : null, $value); |
|
|
} |
|
|
} |
|
|