InfoBlock   A
last analyzed

Complexity

Total Complexity 7

Size/Duplication

Total Lines 52
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 7
eloc 10
dl 0
loc 52
ccs 10
cts 10
cp 1
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getCode() 0 3 1
A getName() 0 3 1
A __construct() 0 5 4
A getType() 0 3 1
1
<?php
2
3
namespace BitrixToolkit\BitrixEntityMapper\Annotation\Entity;
4
5
use Doctrine\Common\Annotations\Annotation\Required;
6
use Doctrine\Common\Annotations\Annotation\Target;
7
8
/**
9
 * @Annotation
10
 * @Target("CLASS")
11
 */
12
final class InfoBlock
13
{
14
    /**
15
     * @var string
16
     * @Required
17
     */
18
    protected $type;
19
20
    /**
21
     * @var string
22
     * @Required
23
     */
24
    protected $code;
25
26
    /**
27
     * @var string
28
     */
29
    protected $name;
30
31
    /**
32
     * InfoBlock constructor.
33
     * @param array $values
34
     */
35 26
    public function __construct(array $values)
36
    {
37 26
        $this->type = isset($values['type']) ? $values['type'] : null;
38 26
        $this->code = isset($values['code']) ? $values['code'] : null;
39 26
        $this->name = isset($values['name']) ? $values['name'] : null;
40
    }
41
42
    /**
43
     * @return string
44
     */
45 24
    public function getType()
46
    {
47 24
        return $this->type;
48
    }
49
50
    /**
51
     * @return string
52
     */
53 23
    public function getCode()
54
    {
55 23
        return $this->code;
56
    }
57
58
    /**
59
     * @return string
60
     */
61 3
    public function getName()
62
    {
63 3
        return $this->name;
64
    }
65
}