@@ -42,7 +42,7 @@ |
||
42 | 42 | ) { |
43 | 43 | parent::__construct($strategy, $voters); |
44 | 44 | |
45 | - $this->actionList = (array) $actions; |
|
45 | + $this->actionList = (array)$actions; |
|
46 | 46 | $this->subjectClassName = $subjectClassName; |
47 | 47 | $this->contextClassName = $contextClassName; |
48 | 48 | } |
@@ -42,6 +42,6 @@ |
||
42 | 42 | } |
43 | 43 | |
44 | 44 | throw new InvalidVotingResultException('No voting assembly for subject::action: '. |
45 | - (string) $votingSubject.'::'.$action); |
|
45 | + (string)$votingSubject.'::'.$action); |
|
46 | 46 | } |
47 | 47 | } |
@@ -32,7 +32,7 @@ |
||
32 | 32 | */ |
33 | 33 | public function __construct(VotingDecisionEnum $resultDecision, $allowedRoles, $reason = null) |
34 | 34 | { |
35 | - $this->allowedRoles = (array) $allowedRoles; |
|
35 | + $this->allowedRoles = (array)$allowedRoles; |
|
36 | 36 | $this->resultDecision = $resultDecision; |
37 | 37 | $this->reason = $reason; |
38 | 38 | } |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | { |
77 | 77 | foreach ($this->voters as $voter) { |
78 | 78 | if (($lastResult = $voter->vote($votingSubject, $votingContext)) !== null) { |
79 | - return new VotingResult($lastResult->getDecision(), [$lastResult]); |
|
79 | + return new VotingResult($lastResult->getDecision(), [ $lastResult ]); |
|
80 | 80 | } |
81 | 81 | } |
82 | 82 | throw new InvalidVotingResultException('Voting assembly did not decide on any result!'); |
@@ -90,10 +90,10 @@ discard block |
||
90 | 90 | */ |
91 | 91 | private function strategyAllowUnlessDenied($votingSubject, IVotingContext $votingContext) |
92 | 92 | { |
93 | - $results = []; |
|
93 | + $results = [ ]; |
|
94 | 94 | foreach ($this->voters as $name => $voter) { |
95 | 95 | if (($lastResult = $voter->vote($votingSubject, $votingContext)) !== null) { |
96 | - $results[] = $lastResult; |
|
96 | + $results[ ] = $lastResult; |
|
97 | 97 | if ($lastResult->getDecision() === VotingDecisionEnum::DENIED()) { |
98 | 98 | return new VotingResult(VotingDecisionEnum::DENIED(), $results); |
99 | 99 | } |
@@ -110,10 +110,10 @@ discard block |
||
110 | 110 | */ |
111 | 111 | private function strategyDenyUnlessAllowed($votingSubject, IVotingContext $votingContext) |
112 | 112 | { |
113 | - $results = []; |
|
113 | + $results = [ ]; |
|
114 | 114 | foreach ($this->voters as $name => $voter) { |
115 | 115 | if (($lastResult = $voter->vote($votingSubject, $votingContext)) !== null) { |
116 | - $results[] = $lastResult; |
|
116 | + $results[ ] = $lastResult; |
|
117 | 117 | if ($lastResult->getDecision() === VotingDecisionEnum::ALLOWED()) { |
118 | 118 | return new VotingResult(VotingDecisionEnum::ALLOWED(), $results); |
119 | 119 | } |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | VotingDecisionEnum $defaultDecision, |
138 | 138 | VotingDecisionEnum $counterDecision |
139 | 139 | ) { |
140 | - $results = []; |
|
140 | + $results = [ ]; |
|
141 | 141 | $decision = $defaultDecision; |
142 | 142 | foreach ($this->voters as $voter) { |
143 | 143 | $result = $voter->vote($votingSubject, $votingContext); |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | if ($result->getDecision() !== $defaultDecision) { |
146 | 146 | $decision = $counterDecision; |
147 | 147 | } |
148 | - $results[] = $result; |
|
148 | + $results[ ] = $result; |
|
149 | 149 | } |
150 | 150 | } |
151 | 151 | return new VotingResult($decision, $results); |