Conditions | 3 |
Paths | 3 |
Total Lines | 16 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 3.7899 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
53 | 10 | private function checkRoles() |
|
54 | { |
||
55 | 10 | $appRoles = $this->getContainer()->getParameter('velikonja_labby.config.roles'); |
|
56 | |||
57 | 10 | foreach ($appRoles as $appRole) { |
|
58 | 10 | if (in_array($appRole, $this->roles)) { |
|
59 | 10 | return true; |
|
60 | } |
||
61 | } |
||
62 | |||
63 | throw new \Exception(sprintf( |
||
64 | 'App role ( %s ) is not allowed. Allowed roles: ( %s ).', |
||
65 | implode(', ', $appRoles), |
||
66 | implode(', ', $this->roles) |
||
67 | )); |
||
68 | } |
||
69 | } |
||
70 |