| Total Complexity | 5 |
| Total Lines | 29 |
| Duplicated Lines | 0 % |
| Coverage | 80% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 9 | class ProfileVoter extends Voter { |
||
| 10 | |||
| 11 | const CHANGE_PASSWORD = 'change_password'; |
||
| 12 | const USE_2FA = 'use_2fa'; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * @inheritDoc |
||
| 16 | */ |
||
| 17 | 7 | protected function supports($attribute, $subject) { |
|
| 18 | 7 | return in_array($attribute, [ static::CHANGE_PASSWORD, static::USE_2FA]); |
|
| 19 | } |
||
| 20 | |||
| 21 | /** |
||
| 22 | * @inheritDoc |
||
| 23 | */ |
||
| 24 | 5 | protected function voteOnAttribute($attribute, $subject, TokenInterface $token) { |
|
| 38 | } |
||
| 39 | } |