Conditions | 5 |
Paths | 5 |
Total Lines | 17 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 30 |
Changes | 0 |
1 | <?php |
||
28 | public function vote(TokenInterface $token, $object, array $attributes) |
||
29 | { |
||
30 | // check if class of this object is supported by this voter |
||
31 | if (!$this->supportsClass(get_class($object))) { |
||
32 | return VoterInterface::ACCESS_ABSTAIN; |
||
33 | } |
||
34 | |||
35 | foreach ($attributes as $attribute) { |
||
36 | if (!$this->supportsAttribute($attribute)) { |
||
37 | continue; |
||
38 | } |
||
39 | |||
40 | if ($this->isPublic($object)) { |
||
41 | return VoterInterface::ACCESS_GRANTED; |
||
42 | } |
||
43 | } |
||
44 | return VoterInterface::ACCESS_ABSTAIN; |
||
45 | } |
||
59 |