| Total Complexity | 4 |
| Total Lines | 32 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 15 | abstract class AbstractVoter implements VoterInterface |
||
| 16 | { |
||
| 17 | const SUPPORTED_ATTRIBUTES = ['VIEW', 'ACTION_POST_UPDATE', 'ACTION_POST_PERSIST']; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * @{inheritDoc} |
||
| 21 | */ |
||
| 22 | 6 | public function supportsAttribute($attribute) |
|
| 23 | { |
||
| 24 | 6 | return in_array($attribute, self::SUPPORTED_ATTRIBUTES); |
|
| 25 | } |
||
| 26 | |||
| 27 | /** |
||
| 28 | * Check if one or more of the given items is not empty |
||
| 29 | * |
||
| 30 | * @param ...$value |
||
| 31 | * @return bool |
||
| 32 | */ |
||
| 33 | 6 | protected static function notEmpty(...$value) |
|
| 36 | } |
||
| 37 | |||
| 38 | /** |
||
| 39 | * Check if the given attributes contain cms roles/attributes |
||
| 40 | * |
||
| 41 | * @param array $attributes |
||
| 42 | * @return bool |
||
| 43 | */ |
||
| 44 | 1 | protected static function hasCmsAttribute(array $attributes = []) |
|
| 47 | } |
||
| 48 | } |