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