| Conditions | 4 |
| Paths | 4 |
| Total Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 4 |
| Changes | 0 | ||
| 1 | <?php |
||
| 32 | 7 | protected function innerVote($action, $votingSubject, IVotingContext $votingContext) |
|
| 33 | { |
||
| 34 | 7 | foreach ($this->votingAssemblies as $votingAssembly) { |
|
| 35 | 7 | if (!($votingAssembly instanceof IVotingAbilityAwareAssembly)) { |
|
| 36 | 1 | throw new InvalidArgumentException('Voting assemblies provided to voting manager must implement IVotingAbilityAwareAssembly interface!'); |
|
| 37 | } |
||
| 38 | |||
| 39 | 6 | if ($votingAssembly->canVoteOn($action, $votingSubject, $votingContext)) { |
|
| 40 | 5 | return $votingAssembly->commenceVote($votingSubject, $votingContext); |
|
| 41 | } |
||
| 42 | } |
||
| 43 | |||
| 44 | 1 | throw new InvalidVotingResultException('No voting assembly for subject::action: '. |
|
| 45 | 1 | (string) $votingSubject.'::'.$action); |
|
| 46 | } |
||
| 47 | } |
||
| 48 |