Restriction   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Test Coverage

Coverage 71.43%

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getChecksByType() 0 3 2
A getChecks() 0 3 1
A addCheck() 0 3 1
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 58
    public function addCheck(string $type, array $value): void
19
    {
20 58
        $this->checks[$type][] = $value;
21 58
    }
22
23
    /**
24
     * @return mixed[][]
25
     */
26 10
    public function getChecks(): array
27
    {
28 10
        return $this->checks;
29
    }
30
31
    /**
32
     * @param string $type
33
     *
34
     * @return mixed[]
35
     */
36
    public function getChecksByType(string $type): array
37
    {
38
        return isset($this->checks[$type]) ? $this->checks[$type] : array();
39
    }
40
}
41