@@ -80,30 +80,25 @@ discard block |
||
80 | 80 | } |
81 | 81 | |
82 | 82 | $out = $this->expectedTarget; |
83 | - } |
|
84 | - elseif (is_string($this->expectedTarget)) { |
|
83 | + } elseif (is_string($this->expectedTarget)) { |
|
85 | 84 | if (class_exists($this->expectedTarget)) { |
86 | 85 | if (! $target instanceof $this->expectedTarget) { |
87 | 86 | throw new BadTargetClassException($this, $this->expectedTarget, $target); |
88 | 87 | } |
89 | - } |
|
90 | - elseif (interface_exists($this->expectedTarget)) { |
|
88 | + } elseif (interface_exists($this->expectedTarget)) { |
|
91 | 89 | if (! $target instanceof $this->expectedTarget) { |
92 | 90 | throw new BadTargetInterfaceException($this, $this->expectedTarget, $target); |
93 | 91 | } |
94 | - } |
|
95 | - elseif (type_exists($this->expectedTarget)) { |
|
92 | + } elseif (type_exists($this->expectedTarget)) { |
|
96 | 93 | if (gettype($target) != $this->expectedTarget) { |
97 | 94 | throw new BadTargetTypeException($this, $this->expectedTarget, $target); |
98 | 95 | } |
99 | - } |
|
100 | - else { |
|
96 | + } else { |
|
101 | 97 | throw new UndefinedTargetClassException($this, $this->expectedTarget); |
102 | 98 | } |
103 | 99 | |
104 | 100 | $out = $target; |
105 | - } |
|
106 | - else { |
|
101 | + } else { |
|
107 | 102 | $out = $target; |
108 | 103 | } |
109 | 104 | |
@@ -131,16 +126,14 @@ discard block |
||
131 | 126 | [$current_chained_subject, $method_name], |
132 | 127 | $arguments |
133 | 128 | ); |
134 | - } |
|
135 | - catch (\BadMethodCallException $e) { |
|
129 | + } catch (\BadMethodCallException $e) { |
|
136 | 130 | if ($this->exceptionTrownFromMagicCall( |
137 | 131 | $e->getTrace(), |
138 | 132 | $current_chained_subject, |
139 | 133 | $method_name |
140 | 134 | )) { |
141 | 135 | $is_called = false; |
142 | - } |
|
143 | - else { |
|
136 | + } else { |
|
144 | 137 | throw $e; |
145 | 138 | } |
146 | 139 | } |
@@ -212,12 +205,10 @@ discard block |
||
212 | 205 | . " nor a function" |
213 | 206 | ); |
214 | 207 | } |
215 | - } |
|
216 | - else { |
|
208 | + } else { |
|
217 | 209 | $out = $out[ $call['entry'] ]; |
218 | 210 | } |
219 | - } |
|
220 | - catch (\Exception $e) { |
|
211 | + } catch (\Exception $e) { |
|
221 | 212 | |
222 | 213 | $callchain_description = $this->toString([ |
223 | 214 | 'target' => $target, |
@@ -56,8 +56,7 @@ discard block |
||
56 | 56 | return static::varExport($argument, ['short_objects']); |
57 | 57 | }, $call['arguments'])); |
58 | 58 | $string .= ')'; |
59 | - } |
|
60 | - else { |
|
59 | + } else { |
|
61 | 60 | $string .= '[' . static::varExport($call['entry'], ['short_objects']) . ']'; |
62 | 61 | } |
63 | 62 | |
@@ -93,8 +92,7 @@ discard block |
||
93 | 92 | |
94 | 93 | if (is_object($variable)) { |
95 | 94 | $export = get_class($variable) . ' #' . spl_object_id($variable); |
96 | - } |
|
97 | - elseif (is_string($variable)) { |
|
95 | + } elseif (is_string($variable)) { |
|
98 | 96 | $keep_length = floor(($options['max_length'] - 5) / 2); |
99 | 97 | |
100 | 98 | $export = substr($variable, 0, (int) $keep_length) |