| 1 | <?php |
||
| 9 | final class RoleVoter implements IVoter |
||
| 10 | { |
||
| 11 | /** |
||
| 12 | * @var string[] |
||
| 13 | */ |
||
| 14 | private $allowedRoles; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * @var VotingDecisionEnum |
||
| 18 | */ |
||
| 19 | private $resultDecision; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * @var mixed|null |
||
| 23 | */ |
||
| 24 | private $reason; |
||
| 25 | |||
| 26 | |||
| 27 | /** |
||
| 28 | * RoleVoter constructor. |
||
| 29 | * @param VotingDecisionEnum $resultDecision |
||
| 30 | * @param string|string[] $allowedRoles |
||
| 31 | * @param mixed $reason |
||
| 32 | */ |
||
| 33 | 10 | public function __construct(VotingDecisionEnum $resultDecision, $allowedRoles, $reason = null) |
|
| 39 | |||
| 40 | |||
| 41 | /** |
||
| 42 | * @param mixed $votingSubject |
||
| 43 | * @param \SpareParts\Overseer\Context\IVotingContext $votingContext |
||
| 44 | * @return ISingleVoterResult |
||
| 45 | */ |
||
| 46 | 10 | public function vote($votingSubject, IVotingContext $votingContext) |
|
| 57 | } |
||
| 58 |