Conditions | 3 |
Paths | 3 |
Total Lines | 10 |
Code Lines | 4 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
33 | 3 | protected function voteOnAttribute($attribute, $subject, TokenInterface $token) |
|
34 | { |
||
35 | // our previous business logic indicates that mods and admins can do it regardless |
||
36 | 3 | foreach ($token->getRoles() as $role) { |
|
37 | 2 | if (\in_array($role->getRole(), ['ROLE_MODERATOR', 'ROLE_ADMIN'])) { |
|
38 | 2 | return true; |
|
39 | } |
||
40 | } |
||
41 | |||
42 | 1 | return false; |
|
43 | } |
||
45 |