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