@@ -93,8 +93,7 @@ discard block |
||
| 93 | 93 | $string = '(new ' . get_called_class(); |
| 94 | 94 | if (is_string($this->expectedTarget)) { |
| 95 | 95 | $string .= '(' . var_export($this->expectedTarget, true) . ')'; |
| 96 | - } |
|
| 97 | - elseif (is_object($this->expectedTarget)) { |
|
| 96 | + } elseif (is_object($this->expectedTarget)) { |
|
| 98 | 97 | $string .= '( ' . get_class($this->expectedTarget) . '#' . spl_object_id($this->expectedTarget) . ' )'; |
| 99 | 98 | } |
| 100 | 99 | $string .= ')'; |
@@ -107,8 +106,7 @@ discard block |
||
| 107 | 106 | return var_export($argument, true); |
| 108 | 107 | }, $call['arguments'])); |
| 109 | 108 | $string .= ')'; |
| 110 | - } |
|
| 111 | - else { |
|
| 109 | + } else { |
|
| 112 | 110 | $string .= '[' . var_export($call['entry'], true) . ']'; |
| 113 | 111 | } |
| 114 | 112 | } |
@@ -131,30 +129,25 @@ discard block |
||
| 131 | 129 | } |
| 132 | 130 | |
| 133 | 131 | $out = $this->expectedTarget; |
| 134 | - } |
|
| 135 | - elseif (is_string($this->expectedTarget)) { |
|
| 132 | + } elseif (is_string($this->expectedTarget)) { |
|
| 136 | 133 | if (class_exists($this->expectedTarget)) { |
| 137 | 134 | if (! $target instanceof $this->expectedTarget) { |
| 138 | 135 | throw new BadTargetClassException($this, $this->expectedTarget, $target); |
| 139 | 136 | } |
| 140 | - } |
|
| 141 | - elseif (interface_exists($this->expectedTarget)) { |
|
| 137 | + } elseif (interface_exists($this->expectedTarget)) { |
|
| 142 | 138 | if (! $target instanceof $this->expectedTarget) { |
| 143 | 139 | throw new BadTargetInterfaceException($this, $this->expectedTarget, $target); |
| 144 | 140 | } |
| 145 | - } |
|
| 146 | - elseif (type_exists($this->expectedTarget)) { |
|
| 141 | + } elseif (type_exists($this->expectedTarget)) { |
|
| 147 | 142 | if (gettype($target) != $this->expectedTarget) { |
| 148 | 143 | throw new BadTargetTypeException($this, $this->expectedTarget, $target); |
| 149 | 144 | } |
| 150 | - } |
|
| 151 | - else { |
|
| 145 | + } else { |
|
| 152 | 146 | throw new UndefinedTargetClassException($this, $this->expectedTarget); |
| 153 | 147 | } |
| 154 | 148 | |
| 155 | 149 | $out = $target; |
| 156 | - } |
|
| 157 | - else { |
|
| 150 | + } else { |
|
| 158 | 151 | $out = $target; |
| 159 | 152 | } |
| 160 | 153 | |
@@ -179,8 +172,7 @@ discard block |
||
| 179 | 172 | $is_called = true; |
| 180 | 173 | try { |
| 181 | 174 | $out = call_user_func_array([$out, $call['method']], $call['arguments']); |
| 182 | - } |
|
| 183 | - catch (\BadMethodCallException $e) { |
|
| 175 | + } catch (\BadMethodCallException $e) { |
|
| 184 | 176 | // Calling a method coded inside a magic __call |
| 185 | 177 | // can produce a BadMethodCallException and thus |
| 186 | 178 | // not be a callable |
@@ -193,8 +185,7 @@ discard block |
||
| 193 | 185 | && $e->getTrace()[0]['class'] == get_class($out) |
| 194 | 186 | ) { |
| 195 | 187 | $is_called = false; |
| 196 | - } |
|
| 197 | - else { |
|
| 188 | + } else { |
|
| 198 | 189 | throw $e; |
| 199 | 190 | } |
| 200 | 191 | } |
@@ -213,12 +204,10 @@ discard block |
||
| 213 | 204 | . " nor a function" |
| 214 | 205 | ); |
| 215 | 206 | } |
| 216 | - } |
|
| 217 | - else { |
|
| 207 | + } else { |
|
| 218 | 208 | $out = $out[ $call['entry'] ]; |
| 219 | 209 | } |
| 220 | - } |
|
| 221 | - catch (\Exception $e) { |
|
| 210 | + } catch (\Exception $e) { |
|
| 222 | 211 | // Throw $e with the good stack (usage exception) |
| 223 | 212 | throw $e; |
| 224 | 213 | } |