Total Complexity | 8 |
Total Lines | 38 |
Duplicated Lines | 0 % |
Coverage | 83.33% |
Changes | 0 |
1 | <?php |
||
19 | class DeleteReviewVoter extends Voter |
||
20 | { |
||
21 | public const CAN_DELETE_REVIEW = 'CAN_DELETE_REVIEW'; |
||
22 | |||
23 | /** |
||
24 | * {@inheritdoc} |
||
25 | */ |
||
26 | 19 | protected function supports($attribute, $subject) |
|
27 | { |
||
28 | // you only want to vote if the attribute and subject are what you expect |
||
29 | 19 | return self::CAN_DELETE_REVIEW === $attribute && ($subject instanceof Review || null === $subject); |
|
30 | } |
||
31 | |||
32 | /** |
||
33 | * {@inheritdoc} |
||
34 | */ |
||
35 | 3 | protected function voteOnAttribute($attribute, $subject, TokenInterface $token) |
|
57 | } |
||
58 | } |
||
59 |