| Total Complexity | 5 |
| Total Lines | 23 |
| Duplicated Lines | 0 % |
| Coverage | 85.71% |
| Changes | 0 | ||
| 1 | <?php |
||
| 13 | final class AuthorVoter extends Voter |
||
| 14 | { |
||
| 15 | /** |
||
| 16 | * {@inheritdoc} |
||
| 17 | */ |
||
| 18 | 7 | protected function supports(string $attribute, $subject): bool |
|
| 19 | { |
||
| 20 | 7 | return $attribute === 'AUTHOR' && ($subject instanceof Article || $subject instanceof Comment); |
|
| 21 | } |
||
| 22 | |||
| 23 | /** |
||
| 24 | * {@inheritdoc} |
||
| 25 | */ |
||
| 26 | 7 | protected function voteOnAttribute(string $attribute, $subject, TokenInterface $token): bool |
|
| 36 | } |
||
| 37 | } |
||
| 38 |