Conditions | 4 |
Paths | 6 |
Total Lines | 14 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 4.128 |
Changes | 0 |
1 | <?php |
||
34 | 3 | protected function innerVote($action, $votingSubject, IVotingContext $votingContext) |
|
35 | { |
||
36 | 3 | if (!($votingSubject instanceof IVotingSubject)) { |
|
37 | 1 | $votingSubject = new VotingSubject($votingSubject); |
|
38 | 1 | } |
|
39 | 3 | foreach ($this->votingAssemblies as $votingAssembly) { |
|
40 | 3 | if ($votingAssembly->canVoteOn($action, $votingSubject, $votingContext)) { |
|
41 | 3 | return $votingAssembly->commenceVote($votingSubject, $votingContext); |
|
42 | } |
||
43 | 2 | } |
|
44 | |||
45 | throw new InvalidVotingResultException('No voting assembly for subject::action: '. |
||
46 | $votingSubject->getVotingSubjectName().'::'.$action); |
||
47 | } |
||
48 | } |
||
49 |