@@ -92,8 +92,7 @@ discard block |
||
| 92 | 92 | $string = '(new ' . get_called_class(); |
| 93 | 93 | if (is_string($this->expectedTarget)) { |
| 94 | 94 | $string .= '(' . var_export($this->expectedTarget, true) . ')'; |
| 95 | - } |
|
| 96 | - elseif (is_object($this->expectedTarget)) { |
|
| 95 | + } elseif (is_object($this->expectedTarget)) { |
|
| 97 | 96 | $string .= '( ' . get_class($this->expectedTarget) . '#' . spl_object_id($this->expectedTarget) . ' )'; |
| 98 | 97 | } |
| 99 | 98 | $string .= ')'; |
@@ -106,8 +105,7 @@ discard block |
||
| 106 | 105 | return var_export($argument, true); |
| 107 | 106 | }, $call['arguments'])); |
| 108 | 107 | $string .= ')'; |
| 109 | - } |
|
| 110 | - else { |
|
| 108 | + } else { |
|
| 111 | 109 | $string .= '[' . var_export($call['entry'], true) . ']'; |
| 112 | 110 | } |
| 113 | 111 | } |
@@ -129,30 +127,25 @@ discard block |
||
| 129 | 127 | } |
| 130 | 128 | |
| 131 | 129 | $out = $this->expectedTarget; |
| 132 | - } |
|
| 133 | - elseif (is_string($this->expectedTarget)) { |
|
| 130 | + } elseif (is_string($this->expectedTarget)) { |
|
| 134 | 131 | if (class_exists($this->expectedTarget)) { |
| 135 | 132 | if (! $target instanceof $this->expectedTarget) { |
| 136 | 133 | throw new BadTargetClassException($this, $this->expectedTarget, $target); |
| 137 | 134 | } |
| 138 | - } |
|
| 139 | - elseif (interface_exists($this->expectedTarget)) { |
|
| 135 | + } elseif (interface_exists($this->expectedTarget)) { |
|
| 140 | 136 | if (! $target instanceof $this->expectedTarget) { |
| 141 | 137 | throw new BadTargetInterfaceException($this, $this->expectedTarget, $target); |
| 142 | 138 | } |
| 143 | - } |
|
| 144 | - elseif (type_exists($this->expectedTarget)) { |
|
| 139 | + } elseif (type_exists($this->expectedTarget)) { |
|
| 145 | 140 | if (gettype($target) != $this->expectedTarget) { |
| 146 | 141 | throw new BadTargetTypeException($this, $this->expectedTarget, $target); |
| 147 | 142 | } |
| 148 | - } |
|
| 149 | - else { |
|
| 143 | + } else { |
|
| 150 | 144 | throw new UndefinedTargetClassException($this, $this->expectedTarget); |
| 151 | 145 | } |
| 152 | 146 | |
| 153 | 147 | $out = $target; |
| 154 | - } |
|
| 155 | - else { |
|
| 148 | + } else { |
|
| 156 | 149 | $out = $target; |
| 157 | 150 | } |
| 158 | 151 | |
@@ -160,12 +153,10 @@ discard block |
||
| 160 | 153 | try { |
| 161 | 154 | if (isset($call['method'])) { |
| 162 | 155 | $out = call_user_func_array([$out, $call['method']], $call['arguments']); |
| 163 | - } |
|
| 164 | - else { |
|
| 156 | + } else { |
|
| 165 | 157 | $out = $out[ $call['entry'] ]; |
| 166 | 158 | } |
| 167 | - } |
|
| 168 | - catch (\Exception $e) { |
|
| 159 | + } catch (\Exception $e) { |
|
| 169 | 160 | // Throw $e with the good stack (usage exception) |
| 170 | 161 | throw $e; |
| 171 | 162 | } |