Entity   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 47
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 6
Bugs 0 Features 0
Metric Value
wmc 2
c 6
b 0
f 0
lcom 0
cbo 0
dl 0
loc 47
ccs 0
cts 5
cp 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __set_state() 0 9 2
1
<?php
2
3
namespace BrainExe\Expression;
4
5
class Entity
6
{
7
8
    /**
9
     * @var int
10
     */
11
    public $expressionId;
12
13
    /**
14
     * @var string[]
15
     */
16
    public $conditions = [];
17
18
    /**
19
     * @var string[]
20
     */
21
    public $actions = [];
22
23
    /**
24
     * @var mixed[]
25
     */
26
    public $payload = [];
27
28
    /**
29
     * @var string
30
     */
31
    public $compiledCondition;
32
33
    /**
34
     * @var bool
35
     */
36
    public $enabled = true;
37
38
    /**
39
     * @param array $array
40
     * @return static
41
     */
42
    public static function __set_state(array $array)
43
    {
44
        $entity = new static();
45
        foreach ($array as $key => $value) {
46
            $entity->$key = $value;
47
        }
48
49
        return $entity;
50
    }
51
}
52