Conditions | 5 |
Paths | 5 |
Total Lines | 15 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 5.1158 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
27 | 1 | public function initAnnotation(array $properties) { |
|
28 | 1 | if (isset($properties[0])) { |
|
29 | 1 | $this->name = $properties[0]; |
|
30 | 1 | unset($properties[0]); |
|
31 | 1 | if (isset($properties[1])) { |
|
32 | $this->level = $properties[1]; |
||
33 | 1 | unset($properties[1]); |
|
34 | } |
||
35 | 1 | } else if (isset($properties['name'])) { |
|
36 | 1 | $this->name = $properties['name']; |
|
37 | 1 | if (isset($properties['level'])) { |
|
38 | 1 | $this->level = $properties['level']; |
|
39 | } |
||
40 | } else { |
||
41 | throw new \Exception('Permission annotation must have a name'); |
||
42 | } |
||
45 |