Completed
Push — master ( 2e4917...2e950a )
by Klaus
19:05 queued 19:05
created

SetVariableExpressionNode   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 1
dl 0
loc 26
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Linio\Component\RuleEngine\Ast;
6
7
class SetVariableExpressionNode extends Node
8
{
9
    protected string $key;
0 ignored issues
show
Bug introduced by
This code did not parse for me. Apparently, there is an error somewhere around this line:

Syntax error, unexpected T_STRING, expecting T_FUNCTION or T_CONST
Loading history...
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