| 1 | <?php |
||
| 9 | class ClosureVoter implements IVoter |
||
| 10 | { |
||
| 11 | /** |
||
| 12 | * @var \Closure |
||
| 13 | */ |
||
| 14 | private $authorizationClosure; |
||
| 15 | |||
| 16 | |||
| 17 | /** |
||
| 18 | * ClosureVoter constructor. |
||
| 19 | * @param \Closure $authorizationClosure |
||
| 20 | */ |
||
| 21 | 3 | public function __construct(\Closure $authorizationClosure) |
|
| 25 | |||
| 26 | |||
| 27 | /** |
||
| 28 | * @param mixed $votingSubject |
||
| 29 | * @param \SpareParts\Overseer\Context\IVotingContext $votingContext |
||
| 30 | * @return ISingleVoterResult |
||
| 31 | */ |
||
| 32 | 2 | public function vote($votingSubject, IVotingContext $votingContext) |
|
| 41 | |||
| 42 | |||
| 43 | /** |
||
| 44 | * @param mixed $result |
||
| 45 | * @return SingleVoterResult |
||
| 46 | */ |
||
| 47 | 2 | protected function prepareResult($result) |
|
| 61 | } |
||
| 62 |