Executor   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 45
c 0
b 0
f 0
wmc 4
lcom 0
cbo 0
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getTraits() 0 4 1
A getCompiledRule() 0 4 1
A getCompiledData() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace RulerZ\Model;
6
7
class Executor
8
{
9
    /**
10
     * List of the traits to use in the executor's code.
11
     *
12
     * @var array
13
     */
14
    private $traits;
15
16
    /**
17
     * Compiled code of the rule.
18
     *
19
     * @var string
20
     */
21
    private $compiledRule;
22
23
    /**
24
     * Data generated by the compiler and stored to be used by the executors.
25
     *
26
     * @var array
27
     */
28
    private $compiledData;
29
30
    public function __construct(array $traits, string $compiledRule, array $compilationData = [])
31
    {
32
        $this->traits = $traits;
33
        $this->compiledRule = $compiledRule;
34
        $this->compiledData = $compilationData;
35
    }
36
37
    public function getTraits(): array
38
    {
39
        return $this->traits;
40
    }
41
42
    public function getCompiledRule(): string
43
    {
44
        return $this->compiledRule;
45
    }
46
47
    public function getCompiledData(): array
48
    {
49
        return $this->compiledData;
50
    }
51
}
52