@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | /** |
13 | 13 | * @var self[] |
14 | 14 | */ |
15 | - static private $registry = []; |
|
15 | + static private $registry = [ ]; |
|
16 | 16 | |
17 | 17 | private function __construct($value) |
18 | 18 | { |
@@ -53,10 +53,10 @@ discard block |
||
53 | 53 | */ |
54 | 54 | private static function instance($string) |
55 | 55 | { |
56 | - if (!isset(static::$registry[$string])) { |
|
57 | - static::$registry[$string] = new static($string); |
|
56 | + if (!isset(static::$registry[ $string ])) { |
|
57 | + static::$registry[ $string ] = new static($string); |
|
58 | 58 | } |
59 | - return static::$registry[$string]; |
|
59 | + return static::$registry[ $string ]; |
|
60 | 60 | } |
61 | 61 | |
62 | 62 |
@@ -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,10 +103,10 @@ 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; |
|
109 | + $results[ ] = $lastResult; |
|
110 | 110 | if ($lastResult->getDecision() == VotingDecisionEnum::DENIED()) { |
111 | 111 | return new VotingResult(VotingDecisionEnum::DENIED(), $results); |
112 | 112 | } |
@@ -123,10 +123,10 @@ discard block |
||
123 | 123 | */ |
124 | 124 | private function strategyDenyUnlessAllowed($votingSubject, $votingContext) |
125 | 125 | { |
126 | - $results = []; |
|
126 | + $results = [ ]; |
|
127 | 127 | foreach ($this->voters as $name => $voter) { |
128 | 128 | if (($lastResult = $voter->vote($votingSubject, $votingContext)) !== null) { |
129 | - $results[] = $lastResult; |
|
129 | + $results[ ] = $lastResult; |
|
130 | 130 | if ($lastResult->getDecision() == VotingDecisionEnum::DENIED()) { |
131 | 131 | return new VotingResult(VotingDecisionEnum::ALLOWED(), $results); |
132 | 132 | } |
@@ -30,7 +30,7 @@ |
||
30 | 30 | */ |
31 | 31 | public function __construct(VotingDecisionEnum $resultDecision, $allowedRoles, $reason = null) |
32 | 32 | { |
33 | - $this->allowedRoles = (array) $allowedRoles; |
|
33 | + $this->allowedRoles = (array)$allowedRoles; |
|
34 | 34 | $this->resultDecision = $resultDecision; |
35 | 35 | $this->reason = $reason; |
36 | 36 | } |
@@ -33,6 +33,6 @@ |
||
33 | 33 | if (is_object($this->subject)) { |
34 | 34 | return get_class($this->subject); |
35 | 35 | } |
36 | - return (string) $this->subject; |
|
36 | + return (string)$this->subject; |
|
37 | 37 | } |
38 | 38 | } |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | /** |
13 | 13 | * @var self[] |
14 | 14 | */ |
15 | - static private $registry = []; |
|
15 | + static private $registry = [ ]; |
|
16 | 16 | |
17 | 17 | private function __construct($value) |
18 | 18 | { |
@@ -53,10 +53,10 @@ discard block |
||
53 | 53 | */ |
54 | 54 | private static function instance($string) |
55 | 55 | { |
56 | - if (!isset(static::$registry[$string])) { |
|
57 | - static::$registry[$string] = new static($string); |
|
56 | + if (!isset(static::$registry[ $string ])) { |
|
57 | + static::$registry[ $string ] = new static($string); |
|
58 | 58 | } |
59 | - return static::$registry[$string]; |
|
59 | + return static::$registry[ $string ]; |
|
60 | 60 | } |
61 | 61 | |
62 | 62 |