| Total Complexity | 4 |
| Total Lines | 26 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | class CreateReviewVoter extends Voter |
||
| 19 | { |
||
| 20 | public const CAN_CREATE_REVIEW = 'CAN_CREATE_REVIEW'; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * {@inheritdoc} |
||
| 24 | */ |
||
| 25 | 21 | protected function supports($attribute, $subject) |
|
| 26 | { |
||
| 27 | // you only want to vote if the attribute and subject are what you expect |
||
| 28 | 21 | return self::CAN_CREATE_REVIEW === $attribute && null === $subject; |
|
| 29 | } |
||
| 30 | |||
| 31 | /** |
||
| 32 | * {@inheritdoc} |
||
| 33 | */ |
||
| 34 | 3 | protected function voteOnAttribute($attribute, $subject, TokenInterface $token) |
|
| 44 | } |
||
| 45 | } |
||
| 46 |