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

Restriction   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Test Coverage

Coverage 71.43%

Importance

Changes 4
Bugs 0 Features 0
Metric Value
dl 0
loc 36
ccs 5
cts 7
cp 0.7143
rs 10
c 4
b 0
f 0
wmc 4

3 Methods

Rating   Name   Duplication   Size   Complexity  
A addCheck() 0 5 1
A getChecksByType() 0 3 2
A getChecks() 0 3 1
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