Completed
Pull Request — master (#4)
by Ondrej
01:56
created
src/StrategyEnum.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/VotingDecisionEnum.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/Assembly/VotingAbilityAwareAssembly.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
src/Assembly/VotingAssembly.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
                 }
Please login to merge, or discard this patch.
src/AbstractVotingManager.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -42,6 +42,6 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
src/Voter/RoleVoter.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@
 block discarded – undo
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
     }
Please login to merge, or discard this patch.