@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | { |
90 | 90 | foreach ($this->voters as $voter) { |
91 | 91 | if (($lastResult = $voter->vote($votingSubject, $votingContext)) !== null) { |
92 | - return new VotingResult($lastResult->getDecision(), [$lastResult]); |
|
92 | + return new VotingResult($lastResult->getDecision(), [$lastResult]); |
|
93 | 93 | } |
94 | 94 | } |
95 | 95 | throw new InvalidVotingResultException('Voting assembly did not decide on any result!'); |
@@ -103,13 +103,13 @@ discard block |
||
103 | 103 | */ |
104 | 104 | private function strategyAllowUnlessDenied($votingSubject, $votingContext) |
105 | 105 | { |
106 | - $results = []; |
|
106 | + $results = []; |
|
107 | 107 | foreach ($this->voters as $name => $voter) { |
108 | 108 | if (($lastResult = $voter->vote($votingSubject, $votingContext)) !== null) { |
109 | - $results[] = $lastResult; |
|
110 | - if ($lastResult->getDecision() === VotingDecisionEnum::DENIED()) { |
|
111 | - return new VotingResult(VotingDecisionEnum::DENIED(), $results); |
|
112 | - } |
|
109 | + $results[] = $lastResult; |
|
110 | + if ($lastResult->getDecision() === VotingDecisionEnum::DENIED()) { |
|
111 | + return new VotingResult(VotingDecisionEnum::DENIED(), $results); |
|
112 | + } |
|
113 | 113 | } |
114 | 114 | } |
115 | 115 | return new VotingResult(VotingDecisionEnum::ALLOWED(), $results); |
@@ -123,16 +123,16 @@ discard block |
||
123 | 123 | */ |
124 | 124 | private function strategyDenyUnlessAllowed($votingSubject, $votingContext) |
125 | 125 | { |
126 | - $results = []; |
|
127 | - foreach ($this->voters as $name => $voter) { |
|
128 | - if (($lastResult = $voter->vote($votingSubject, $votingContext)) !== null) { |
|
129 | - $results[] = $lastResult; |
|
130 | - if ($lastResult->getDecision() === VotingDecisionEnum::ALLOWED()) { |
|
131 | - return new VotingResult(VotingDecisionEnum::ALLOWED(), $results); |
|
132 | - } |
|
133 | - } |
|
134 | - } |
|
135 | - return new VotingResult(VotingDecisionEnum::DENIED(), $results); |
|
126 | + $results = []; |
|
127 | + foreach ($this->voters as $name => $voter) { |
|
128 | + if (($lastResult = $voter->vote($votingSubject, $votingContext)) !== null) { |
|
129 | + $results[] = $lastResult; |
|
130 | + if ($lastResult->getDecision() === VotingDecisionEnum::ALLOWED()) { |
|
131 | + return new VotingResult(VotingDecisionEnum::ALLOWED(), $results); |
|
132 | + } |
|
133 | + } |
|
134 | + } |
|
135 | + return new VotingResult(VotingDecisionEnum::DENIED(), $results); |
|
136 | 136 | } |
137 | 137 | |
138 | 138 |