| Total Complexity | 1 |
| Total Lines | 48 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 20 | abstract class Voter |
||
| 21 | { |
||
| 22 | /** |
||
| 23 | * security |
||
| 24 | * |
||
| 25 | * @var \EWW\Dpf\Security\Security |
||
| 26 | * @inject |
||
| 27 | */ |
||
| 28 | protected $security = null; |
||
| 29 | |||
| 30 | /** |
||
| 31 | * supported attributes |
||
| 32 | * |
||
| 33 | * @var array |
||
| 34 | */ |
||
| 35 | protected $attributes = array(); |
||
| 36 | |||
| 37 | |||
| 38 | /** |
||
| 39 | * Determines if the voter supports the given attribute. |
||
| 40 | * |
||
| 41 | * @param string $attribute |
||
| 42 | * @param mixed $subject |
||
| 43 | * @return mixed |
||
| 44 | */ |
||
| 45 | abstract public static function supports($attribute, $subject); |
||
| 46 | |||
| 47 | |||
| 48 | /** |
||
| 49 | * Determines if access for the given attribute and subject is allowed. |
||
| 50 | * |
||
| 51 | * @param string $attribute |
||
| 52 | * @param mixed $subject |
||
| 53 | * @return mixed |
||
| 54 | */ |
||
| 55 | abstract public function voteOnAttribute($attribute, $subject = NULL); |
||
| 56 | |||
| 57 | |||
| 58 | /** |
||
| 59 | * Returns all available voters. |
||
| 60 | * |
||
| 61 | * @return array |
||
| 62 | */ |
||
| 63 | public static function getVoters() |
||
| 70 | } |