Conditions | 5 |
Paths | 4 |
Total Lines | 27 |
Code Lines | 18 |
Lines | 0 |
Ratio | 0 % |
Tests | 18 |
CRAP Score | 5 |
Changes | 3 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
19 | 32 | public function check(Resource $resource) |
|
20 | { |
||
21 | 32 | foreach ($resource->mandatory() as $key => $value) { |
|
22 | 19 | if (isset($value['when']['has_value'])) { |
|
23 | 4 | $name = $value['when']['property']; |
|
24 | 4 | $value = $value['when']['has_value']; |
|
25 | |||
26 | 4 | if (is_array($value)) { |
|
27 | 3 | foreach ($value as $value) { |
|
28 | 3 | $this->ensurePropertyNameHasKey( |
|
29 | 3 | $resource, |
|
30 | 3 | $value, |
|
31 | 3 | $name, |
|
32 | 3 | $key |
|
33 | ); |
||
34 | } |
||
35 | } else { |
||
36 | 1 | $this->ensurePropertyNameHasKey( |
|
37 | 1 | $resource, |
|
38 | 1 | $value, |
|
39 | 1 | $name, |
|
40 | 1 | $key |
|
41 | ); |
||
42 | } |
||
43 | } |
||
44 | } |
||
45 | 30 | } |
|
46 | |||
58 |