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