Passed
Push — master ( b09f9f...d91b12 )
by Sebastian
03:06
created
src/Mailcode/Commands.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
     {
47 47
         static $ids = array();
48 48
         
49
-        if(empty($ids)) {
49
+        if (empty($ids)) {
50 50
             $ids = FileHelper::createFileFinder(__DIR__.'/Commands/Command')
51 51
             ->getPHPClassNames();
52 52
         }
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
      */
65 65
     public function getAll()
66 66
     {
67
-        if(!empty($this->commands)) {
67
+        if (!empty($this->commands)) {
68 68
             return $this->commands;
69 69
         }
70 70
         
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
         
73 73
         $result = array();
74 74
         
75
-        foreach($ids as $id) 
75
+        foreach ($ids as $id) 
76 76
         {
77 77
             $result[] = $this->getDummyCommand($id);
78 78
         }
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
     {
98 98
         static $instances = array();
99 99
         
100
-        if(!isset($instances[$id])) 
100
+        if (!isset($instances[$id])) 
101 101
         {
102 102
             $instances[$id] = $this->createCommand($id, '__dummy', '', '');
103 103
         }
@@ -118,9 +118,9 @@  discard block
 block discarded – undo
118 118
     {
119 119
         $items = $this->getAll();
120 120
         
121
-        foreach($items as $item) 
121
+        foreach ($items as $item) 
122 122
         {
123
-            if($item->getName() === $name) {
123
+            if ($item->getName() === $name) {
124 124
                 return $item->getID();
125 125
             }
126 126
         }
@@ -152,9 +152,9 @@  discard block
 block discarded – undo
152 152
     {
153 153
         $items = $this->getAll();
154 154
         
155
-        foreach($items as $item)
155
+        foreach ($items as $item)
156 156
         {
157
-            if($item->getName() === $name) {
157
+            if ($item->getName() === $name) {
158 158
                 return true;
159 159
             }
160 160
         }
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
     {
167 167
         $class = $this->resolveClassName($id, $type);
168 168
         
169
-        if(!class_exists($class))
169
+        if (!class_exists($class))
170 170
         {
171 171
             throw new Mailcode_Exception(
172 172
                 'No such command',
@@ -188,9 +188,9 @@  discard block
 block discarded – undo
188 188
         
189 189
         $dummy = $this->getDummyCommand($id);
190 190
         
191
-        if($dummy->supportsType())
191
+        if ($dummy->supportsType())
192 192
         {
193
-            if(empty($type))
193
+            if (empty($type))
194 194
             {
195 195
                 $type = $dummy->getDefaultType();
196 196
             }
@@ -228,14 +228,14 @@  discard block
 block discarded – undo
228 228
      */
229 229
     private function getDummyCommand(string $id) : Mailcode_Commands_Command
230 230
     {
231
-        if(isset(self::$dummyCommands[$id])) {
231
+        if (isset(self::$dummyCommands[$id])) {
232 232
             return self::$dummyCommands[$id];
233 233
         }
234 234
 
235 235
         $class = 'Mailcode\Mailcode_Commands_Command_'.$id;
236 236
         $cmd = new $class('__dummy');
237 237
 
238
-        if($cmd instanceof Mailcode_Commands_Command)
238
+        if ($cmd instanceof Mailcode_Commands_Command)
239 239
         {
240 240
             self::$dummyCommands[$id] = $cmd;
241 241
             return $cmd;
Please login to merge, or discard this patch.