Completed
Push — php-7.1 ( d2218e...926e65 )
by SignpostMarv
08:16
created

Restriction::loadRestriction()   B

Complexity

Conditions 2
Paths 2

Size

Total Lines 33
Code Lines 24

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 19
CRAP Score 2

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 2
eloc 24
c 2
b 0
f 0
nc 2
nop 3
dl 0
loc 33
ccs 19
cts 19
cp 1
crap 2
rs 8.8571
1
<?php
2
3
declare(strict_types=1);
4
5
namespace GoetasWebservices\XML\XSDReader\Schema\Inheritance;
6
7
class Restriction extends Base
8
{
9
    /**
10
     * @var mixed[][]
11
     */
12
    protected $checks = array();
13
14
    /**
15
     * @param string  $type
16
     * @param mixed[] $value
17
     *
18
     * @return $this
19
     */
20
    public function addCheck(string $type, array $value)
21
    {
22
        $this->checks[$type][] = $value;
23
24
        return $this;
25 45
    }
26
27 45
    /**
28
     * @return mixed[][]
29 45
     */
30
    public function getChecks(): array
31
    {
32
        return $this->checks;
33
    }
34
35 10
    /**
36
     * @param string $type
37 10
     *
38
     * @return mixed[]
39
     */
40
    public function getChecksByType(string $type): array
41
    {
42
        return isset($this->checks[$type]) ? $this->checks[$type] : array();
43
    }
44
}
45