Completed
Push — master ( 189c17...fbfe44 )
by Jean
08:08
created
src_5.6/Exceptions/BadTargetInterfaceException.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,6 +25,6 @@
 block discarded – undo
25 25
      */
26 26
     public function __construct(DeferredCallChain $callchain, $expected_target, $target)
27 27
     {
28
-        $this->message = "You are trying to define a target of class " . get_class($target) . " for the {$callchain} allowing only targets implementing " . $expected_target;
28
+        $this->message = "You are trying to define a target of class ".get_class($target)." for the {$callchain} allowing only targets implementing ".$expected_target;
29 29
     }
30 30
 }
31 31
\ No newline at end of file
Please login to merge, or discard this patch.
src_5.6/DeferredCallChain.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -81,11 +81,11 @@  discard block
 block discarded – undo
81 81
             $out = $this->expectedTarget;
82 82
         } elseif (is_string($this->expectedTarget)) {
83 83
             if (class_exists($this->expectedTarget)) {
84
-                if (!$target instanceof $this->expectedTarget) {
84
+                if ( ! $target instanceof $this->expectedTarget) {
85 85
                     throw new BadTargetClassException($this, $this->expectedTarget, $target);
86 86
                 }
87 87
             } elseif (interface_exists($this->expectedTarget)) {
88
-                if (!$target instanceof $this->expectedTarget) {
88
+                if ( ! $target instanceof $this->expectedTarget) {
89 89
                     throw new BadTargetInterfaceException($this, $this->expectedTarget, $target);
90 90
                 }
91 91
             } elseif (type_exists($this->expectedTarget)) {
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
                 } elseif (is_string($current_chained_subject)) {
125 125
                     $class = $current_chained_subject;
126 126
                 }
127
-                $callable = $class . '::' . $method_name;
127
+                $callable = $class.'::'.$method_name;
128 128
             }
129 129
             $current_chained_subject = call_user_func_array($callable, $arguments);
130 130
         } catch (\BadMethodCallException $e) {
@@ -169,23 +169,23 @@  discard block
 block discarded – undo
169 169
                     if (is_callable([$out, $call['method']])) {
170 170
                         $is_called = $this->checkMethodIsReallyCallable('->', $out, $call['method'], $call['arguments']);
171 171
                     }
172
-                    if (!$is_called && (is_string($out) && is_callable($out . '::' . $call['method']) || is_object($out) && is_callable(get_class($out) . '::' . $call['method']))) {
172
+                    if ( ! $is_called && (is_string($out) && is_callable($out.'::'.$call['method']) || is_object($out) && is_callable(get_class($out).'::'.$call['method']))) {
173 173
                         $is_called = $this->checkMethodIsReallyCallable('::', $out, $call['method'], $call['arguments']);
174 174
                     }
175
-                    if (!$is_called && is_callable($call['method'])) {
175
+                    if ( ! $is_called && is_callable($call['method'])) {
176 176
                         $arguments = $this->prepareArgs($call['arguments'], $out);
177 177
                         $out = call_user_func_array($call['method'], $arguments);
178 178
                         $is_called = true;
179 179
                     }
180
-                    if (!$is_called) {
181
-                        throw new \BadMethodCallException($call['method'] . "() is neither a method of " . get_class($out) . " nor a function");
180
+                    if ( ! $is_called) {
181
+                        throw new \BadMethodCallException($call['method']."() is neither a method of ".get_class($out)." nor a function");
182 182
                     }
183 183
                 } else {
184 184
                     $out = $out[$call['entry']];
185 185
                 }
186 186
             } catch (\Exception $e) {
187 187
                 $callchain_description = $this->toString(['target' => $target, 'limit' => $i]);
188
-                VisibilityViolator::setHiddenProperty($e, 'message', $e->getMessage() . "\nWhen applying {$callchain_description} defined at " . $call['file'] . ':' . $call['line']);
188
+                VisibilityViolator::setHiddenProperty($e, 'message', $e->getMessage()."\nWhen applying {$callchain_description} defined at ".$call['file'].':'.$call['line']);
189 189
                 // Throw $e with the good stack (usage exception)
190 190
                 throw $e;
191 191
             }
Please login to merge, or discard this patch.
src_5.6/ExportTrait.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -45,21 +45,21 @@  discard block
 block discarded – undo
45 45
         $target = isset($options['target']) ? $options['target'] : $this->expectedTarget;
46 46
         $max_param_length = isset($options['max_parameter_length']) ? $options['max_parameter_length'] : 56;
47 47
         $short_objects = isset($options['short_objects']) ? $options['short_objects'] : true;
48
-        $string = '(new ' . get_called_class();
49
-        $target && ($string .= '(' . static::varExport($target, ['short_objects' => $short_objects, 'max_length' => $max_param_length]) . ')');
48
+        $string = '(new '.get_called_class();
49
+        $target && ($string .= '('.static::varExport($target, ['short_objects' => $short_objects, 'max_length' => $max_param_length]).')');
50 50
         $string .= ')';
51 51
         foreach ($this->stack as $i => $call) {
52 52
             if (isset($call['method'])) {
53 53
                 $string .= '->';
54
-                $string .= $call['method'] . '(';
55
-                $string .= implode(', ', array_map(function ($argument) use($max_param_length, $short_objects) {
54
+                $string .= $call['method'].'(';
55
+                $string .= implode(', ', array_map(function($argument) use($max_param_length, $short_objects) {
56 56
                     return static::varExport($argument, ['short_objects' => $short_objects, 'max_length' => $max_param_length]);
57 57
                 }, $call['arguments']));
58 58
                 $string .= ')';
59 59
             } else {
60
-                $string .= '[' . static::varExport($call['entry'], ['short_objects' => $short_objects, 'max_length' => $max_param_length]) . ']';
60
+                $string .= '['.static::varExport($call['entry'], ['short_objects' => $short_objects, 'max_length' => $max_param_length]).']';
61 61
             }
62
-            if (!empty($options['limit']) && $options['limit'] == $i) {
62
+            if ( ! empty($options['limit']) && $options['limit'] == $i) {
63 63
                 break;
64 64
             }
65 65
         }
@@ -75,20 +75,20 @@  discard block
 block discarded – undo
75 75
     protected static function varExport($variable, array $options = [])
76 76
     {
77 77
         $options['max_length'] = isset($options['max_length']) ? $options['max_length'] : 56;
78
-        $options['short_objects'] = !empty($options['short_objects']) || in_array('short_objects', $options);
78
+        $options['short_objects'] = ! empty($options['short_objects']) || in_array('short_objects', $options);
79 79
         $export = var_export($variable, true);
80 80
         if ($options['short_objects']) {
81 81
             if (is_object($variable)) {
82
-                $export = ' ' . get_class($variable) . ' #' . spl_object_id($variable) . ' ';
82
+                $export = ' '.get_class($variable).' #'.spl_object_id($variable).' ';
83 83
             }
84 84
         }
85 85
         if (strlen($export) > $options['max_length']) {
86 86
             if (is_object($variable)) {
87 87
                 // shortening short objects would only slow the workflow
88
-                $export = get_class($variable) . ' #' . spl_object_id($variable);
88
+                $export = get_class($variable).' #'.spl_object_id($variable);
89 89
             } elseif (is_string($variable)) {
90 90
                 $keep_length = floor(($options['max_length'] - 5) / 2);
91
-                $export = substr($variable, 0, (int) $keep_length) . ' ... ' . substr($variable, -$keep_length);
91
+                $export = substr($variable, 0, (int) $keep_length).' ... '.substr($variable, -$keep_length);
92 92
             }
93 93
         }
94 94
         return $export;
Please login to merge, or discard this patch.
src_5.6/functions.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@  discard block
 block discarded – undo
3 3
 /**
4 4
  * File gathering functions
5 5
  */
6
-if (!function_exists('type_exists')) {
6
+if ( ! function_exists('type_exists')) {
7 7
     /**
8 8
      * Checks if a type is a valid PHP one.
9 9
      * 
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
         return in_array($type_name, ["boolean", "integer", "double", "string", "array", "object", "resource", "resource (closed)", "NULL", "unknown type"]);
16 16
     }
17 17
 }
18
-if (!function_exists('later')) {
18
+if ( ! function_exists('later')) {
19 19
     /**
20 20
      * Create a deferred call chain in a functionnal way.
21 21
      * 
Please login to merge, or discard this patch.
classmap.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@  discard block
 block discarded – undo
3 3
  */ 
4 4
 function scandir_r($directory) {
5 5
     // $files = array_slice(scandir($directory, SCANDIR_SORT_NONE), 2);
6
-    if (! $entries = scandir($directory)) {
6
+    if ( ! $entries = scandir($directory)) {
7 7
         throw new \InvalidArgumentException("Error during scandir");
8 8
     }
9 9
     
@@ -11,12 +11,12 @@  discard block
 block discarded – undo
11 11
 
12 12
     $map = [];
13 13
     foreach ($files as $file) {
14
-        if (is_dir( $directory . '/' . $file)) {
15
-            $submap = scandir_r($directory . '/' . $file);
14
+        if (is_dir($directory.'/'.$file)) {
15
+            $submap = scandir_r($directory.'/'.$file);
16 16
             $map = array_merge($map, $submap);
17 17
         }
18 18
         else {
19
-            $map[] = $directory . '/' . $file;
19
+            $map[] = $directory.'/'.$file;
20 20
         }
21 21
     }
22 22
     
@@ -56,11 +56,11 @@  discard block
 block discarded – undo
56 56
 if ($missing = array_diff($sorted_map, $map)) {
57 57
     throw new \Exception(
58 58
         "Missing file in your classmap. Please add it manually to "
59
-        . __FILE__ . "\n"
59
+        . __FILE__."\n"
60 60
         . var_export($missing, true)
61 61
     );
62 62
 }
63 63
 
64 64
 foreach ($sorted_map as $filepath) {
65
-    require_once($root . '/' . $filepath);
65
+    require_once($root.'/'.$filepath);
66 66
 }
Please login to merge, or discard this patch.