Passed
Push — static-analysis ( 1958c5...5a8282 )
by SignpostMarv
10:41 queued 08:16
created

Restriction::loadRestriction()   B

Complexity

Conditions 2
Paths 2

Size

Total Lines 32
Code Lines 22

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 19
CRAP Score 2

Importance

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