Passed
Push — master ( c26772...f9347c )
by Jean
02:16
created
src/DeferredCallChain.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
      * 
34 34
      * @param string $key The entry to acces
35 35
      */
36
-    public function __construct($class_type_or_instance=null)
36
+    public function __construct($class_type_or_instance = null)
37 37
     {
38 38
         if ($class_type_or_instance) {
39 39
             $this->expectedTarget = $class_type_or_instance;
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
         foreach ($this->stack as $i => $call) {
103 103
             if (isset($call['method'])) {
104 104
                 $string .= '->';
105
-                $string .= $call['method'].'(';
105
+                $string .= $call['method'] . '(';
106 106
                 $string .= implode(', ', array_map(function($argument) {
107 107
                     return var_export($argument, true);
108 108
                 }, $call['arguments']));
@@ -134,12 +134,12 @@  discard block
 block discarded – undo
134 134
         }
135 135
         elseif (is_string($this->expectedTarget)) {
136 136
             if (class_exists($this->expectedTarget)) {
137
-                if (! $target instanceof $this->expectedTarget) {
137
+                if (!$target instanceof $this->expectedTarget) {
138 138
                     throw new BadTargetClassException($this, $this->expectedTarget, $target);
139 139
                 }
140 140
             }
141 141
             elseif (interface_exists($this->expectedTarget)) {
142
-                if (! $target instanceof $this->expectedTarget) {
142
+                if (!$target instanceof $this->expectedTarget) {
143 143
                     throw new BadTargetInterfaceException($this, $this->expectedTarget, $target);
144 144
                 }
145 145
             }
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
      * @param  mixed $target The target to apply the callchain on
234 234
      * @return mixde The value returned once the call chain is called uppon $target
235 235
      */
236
-    public function __invoke($target=null)
236
+    public function __invoke($target = null)
237 237
     {
238 238
         $out = $this->checkTarget($target);
239 239
         
@@ -249,13 +249,13 @@  discard block
 block discarded – undo
249 249
                         );
250 250
                     }
251 251
                     
252
-                    if (! $is_called && is_callable($call['method'])) {
252
+                    if (!$is_called && is_callable($call['method'])) {
253 253
                         $arguments = $this->prepareArgs($call['arguments'], $out);
254 254
                         $out = call_user_func_array($call['method'], $arguments);
255 255
                         $is_called = true;
256 256
                     }
257 257
                     
258
-                    if (! $is_called) {
258
+                    if (!$is_called) {
259 259
                         throw new \BadMethodCallException(
260 260
                             $call['method'] . "() is neither a method of " . get_class($out)
261 261
                             . " nor a function"
@@ -263,7 +263,7 @@  discard block
 block discarded – undo
263 263
                     }
264 264
                 }
265 265
                 else {
266
-                    $out = $out[ $call['entry'] ];
266
+                    $out = $out[$call['entry']];
267 267
                 }
268 268
             }
269 269
             catch (\Exception $e) {
Please login to merge, or discard this patch.