@@ -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 | |
@@ -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 | |
@@ -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 | } |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | { |
| 71 | 71 | foreach ($this->voters as $voter) { |
| 72 | 72 | if (($lastResult = $voter->vote($votingSubject, $votingContext)) !== null) { |
| 73 | - return new VotingResult($lastResult->getDecision(), [$lastResult]); |
|
| 73 | + return new VotingResult($lastResult->getDecision(), [ $lastResult ]); |
|
| 74 | 74 | } |
| 75 | 75 | } |
| 76 | 76 | throw new InvalidVotingResultException('Voting assembly did not decide on any result!'); |
@@ -84,10 +84,10 @@ discard block |
||
| 84 | 84 | */ |
| 85 | 85 | private function strategyAllowUnlessDenied($votingSubject, IVotingContext $votingContext) |
| 86 | 86 | { |
| 87 | - $results = []; |
|
| 87 | + $results = [ ]; |
|
| 88 | 88 | foreach ($this->voters as $name => $voter) { |
| 89 | 89 | if (($lastResult = $voter->vote($votingSubject, $votingContext)) !== null) { |
| 90 | - $results[] = $lastResult; |
|
| 90 | + $results[ ] = $lastResult; |
|
| 91 | 91 | if ($lastResult->getDecision() === VotingDecisionEnum::DENIED()) { |
| 92 | 92 | return new VotingResult(VotingDecisionEnum::DENIED(), $results); |
| 93 | 93 | } |
@@ -104,10 +104,10 @@ discard block |
||
| 104 | 104 | */ |
| 105 | 105 | private function strategyDenyUnlessAllowed($votingSubject, IVotingContext $votingContext) |
| 106 | 106 | { |
| 107 | - $results = []; |
|
| 107 | + $results = [ ]; |
|
| 108 | 108 | foreach ($this->voters as $name => $voter) { |
| 109 | 109 | if (($lastResult = $voter->vote($votingSubject, $votingContext)) !== null) { |
| 110 | - $results[] = $lastResult; |
|
| 110 | + $results[ ] = $lastResult; |
|
| 111 | 111 | if ($lastResult->getDecision() === VotingDecisionEnum::ALLOWED()) { |
| 112 | 112 | return new VotingResult(VotingDecisionEnum::ALLOWED(), $results); |
| 113 | 113 | } |
@@ -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 | } |