| 1 | <?php |
||
| 7 | class SetVariableExpressionNode extends Node |
||
| 8 | { |
||
| 9 | protected string $key; |
||
|
|
|||
| 10 | protected Node $value; |
||
| 11 | |||
| 12 | public function __construct(string $key, Node $value) |
||
| 13 | { |
||
| 14 | $this->key = $key; |
||
| 15 | $this->value = $value; |
||
| 16 | } |
||
| 17 | |||
| 18 | public function evaluate() |
||
| 19 | { |
||
| 20 | $this->getContext()->set($this->key, $this->value->evaluate()); |
||
| 21 | } |
||
| 22 | } |
||
| 23 |