@@ -64,8 +64,7 @@ discard block |
||
64 | 64 | ]); |
65 | 65 | }, $call['arguments'])); |
66 | 66 | $string .= ')'; |
67 | - } |
|
68 | - else { |
|
67 | + } else { |
|
69 | 68 | $string .= '[' . static::varExport($call['entry'], [ |
70 | 69 | 'short_objects' => $short_objects, |
71 | 70 | 'max_length' => $max_param_length, |
@@ -105,8 +104,7 @@ discard block |
||
105 | 104 | if (is_object($variable)) { |
106 | 105 | // shortening short objects would only slow the workflow |
107 | 106 | $export = get_class($variable) . ' #' . spl_object_id($variable); |
108 | - } |
|
109 | - elseif (is_string($variable)) { |
|
107 | + } elseif (is_string($variable)) { |
|
110 | 108 | $keep_length = floor(($options['max_length'] - 5) / 2); |
111 | 109 | |
112 | 110 | $export = substr($variable, 0, (int) $keep_length) |
@@ -98,30 +98,25 @@ discard block |
||
98 | 98 | } |
99 | 99 | |
100 | 100 | $out = $this->expectedTarget; |
101 | - } |
|
102 | - elseif (is_string($this->expectedTarget)) { |
|
101 | + } elseif (is_string($this->expectedTarget)) { |
|
103 | 102 | if (class_exists($this->expectedTarget)) { |
104 | 103 | if (! $target instanceof $this->expectedTarget) { |
105 | 104 | throw new BadTargetClassException($this, $this->expectedTarget, $target); |
106 | 105 | } |
107 | - } |
|
108 | - elseif (interface_exists($this->expectedTarget)) { |
|
106 | + } elseif (interface_exists($this->expectedTarget)) { |
|
109 | 107 | if (! $target instanceof $this->expectedTarget) { |
110 | 108 | throw new BadTargetInterfaceException($this, $this->expectedTarget, $target); |
111 | 109 | } |
112 | - } |
|
113 | - elseif (type_exists($this->expectedTarget)) { |
|
110 | + } elseif (type_exists($this->expectedTarget)) { |
|
114 | 111 | if (gettype($target) != $this->expectedTarget) { |
115 | 112 | throw new BadTargetTypeException($this, $this->expectedTarget, $target); |
116 | 113 | } |
117 | - } |
|
118 | - else { |
|
114 | + } else { |
|
119 | 115 | throw new UndefinedTargetClassException($this, $this->expectedTarget); |
120 | 116 | } |
121 | 117 | |
122 | 118 | $out = $target; |
123 | - } |
|
124 | - else { |
|
119 | + } else { |
|
125 | 120 | $out = $target; |
126 | 121 | } |
127 | 122 | |
@@ -148,12 +143,10 @@ discard block |
||
148 | 143 | try { |
149 | 144 | if ($method_type == '->') { |
150 | 145 | $callable = [$current_chained_subject, $method_name]; |
151 | - } |
|
152 | - elseif ($method_type == '::') { |
|
146 | + } elseif ($method_type == '::') { |
|
153 | 147 | if (is_object($current_chained_subject)) { |
154 | 148 | $class = get_class($current_chained_subject); |
155 | - } |
|
156 | - elseif (is_string($current_chained_subject)) { |
|
149 | + } elseif (is_string($current_chained_subject)) { |
|
157 | 150 | $class = $current_chained_subject; |
158 | 151 | } |
159 | 152 | |
@@ -164,16 +157,14 @@ discard block |
||
164 | 157 | $callable, |
165 | 158 | $arguments |
166 | 159 | ); |
167 | - } |
|
168 | - catch (\BadMethodCallException $e) { |
|
160 | + } catch (\BadMethodCallException $e) { |
|
169 | 161 | if ($this->exceptionTrownFromMagicCall( |
170 | 162 | $e->getTrace(), |
171 | 163 | $current_chained_subject, |
172 | 164 | $method_name |
173 | 165 | )) { |
174 | 166 | $is_called = false; |
175 | - } |
|
176 | - else { |
|
167 | + } else { |
|
177 | 168 | throw $e; |
178 | 169 | } |
179 | 170 | } |
@@ -259,12 +250,10 @@ discard block |
||
259 | 250 | . " nor a function" |
260 | 251 | ); |
261 | 252 | } |
262 | - } |
|
263 | - else { |
|
253 | + } else { |
|
264 | 254 | $out = $out[ $call['entry'] ]; |
265 | 255 | } |
266 | - } |
|
267 | - catch (\Exception $e) { |
|
256 | + } catch (\Exception $e) { |
|
268 | 257 | |
269 | 258 | $callchain_description = $this->toString([ |
270 | 259 | 'target' => $target, |