|
9 | 9 | * file that was distributed with this source code.
|
10 | 10 | */
|
11 | 11 |
|
| 12 | +namespace Symfony\Component\HttpKernel\Exception; |
| 13 | + |
| 14 | +use Symfony\Component\Debug\Exception\FlattenException as DebugFlattenException; |
| 15 | + |
| 16 | +/** |
| 17 | + * FlattenException wraps a PHP Exception to be able to serialize it. |
| 18 | + * |
| 19 | + * Basically, this class removes all objects from the trace. |
| 20 | + * |
| 21 | + * @author Fabien Potencier <[email protected]> |
| 22 | + * |
| 23 | + * @deprecated Deprecated in 2.3, to be removed in 3.0. Use the same class from the Debug component instead. |
| 24 | + */ |
| 25 | +class FlattenException |
| 26 | +{ |
| 27 | + private $handler; |
| 28 | + |
| 29 | + public static function __callStatic($method, $args) |
| 30 | + { |
| 31 | + if (!method_exists('Symfony\Component\Debug\Exception\FlattenException', $method)) { |
| 32 | + throw new \BadMethodCallException(sprintf('Call to undefined method %s::%s()', get_called_class(), $method)); |
| 33 | + } |
| 34 | + |
| 35 | + return call_user_func_array(array('Symfony\Component\Debug\Exception\FlattenException', $method), $args); |
| 36 | + } |
| 37 | + |
| 38 | + public function __call($method, $args) |
| 39 | + { |
| 40 | + if (!isset($this->handler)) { |
| 41 | + $this->handler = new DebugFlattenException(); |
| 42 | + } |
| 43 | + |
| 44 | + if (!method_exists($this->handler, $method)) { |
| 45 | + throw new \BadMethodCallException(sprintf('Call to undefined method %s::%s()', get_class($this), $method)); |
| 46 | + } |
| 47 | + |
| 48 | + return call_user_func_array(array($this->handler, $method), $args); |
| 49 | + } |
| 50 | +} |
| 51 | + |
12 | 52 | namespace Symfony\Component\Debug\Exception;
|
13 | 53 |
|
14 | 54 | use Symfony\Component\HttpKernel\Exception\FlattenException as LegacyFlattenException;
|
@@ -279,35 +319,3 @@ private function getClassNameFromIncomplete(\__PHP_Incomplete_Class $value)
|
279 | 319 | return $array['__PHP_Incomplete_Class_Name'];
|
280 | 320 | }
|
281 | 321 | }
|
282 |
| - |
283 |
| -namespace Symfony\Component\HttpKernel\Exception; |
284 |
| - |
285 |
| -use Symfony\Component\Debug\Exception\FlattenException as DebugFlattenException; |
286 |
| - |
287 |
| -/** |
288 |
| - * FlattenException wraps a PHP Exception to be able to serialize it. |
289 |
| - * |
290 |
| - * Basically, this class removes all objects from the trace. |
291 |
| - * |
292 |
| - * @author Fabien Potencier <[email protected]> |
293 |
| - * |
294 |
| - * @deprecated Deprecated in 2.3, to be removed in 3.0. Use the same class from the Debug component instead. |
295 |
| - */ |
296 |
| -class FlattenException |
297 |
| -{ |
298 |
| - private $handler; |
299 |
| - |
300 |
| - public static function __callStatic($method, $args) |
301 |
| - { |
302 |
| - return forward_static_call_array(array('Symfony\Component\Debug\Exception\FlattenException', $method), $args); |
303 |
| - } |
304 |
| - |
305 |
| - public function __call($method, $args) |
306 |
| - { |
307 |
| - if (!isset($this->handler)) { |
308 |
| - $this->handler = new DebugFlattenException(); |
309 |
| - } |
310 |
| - |
311 |
| - return call_user_func_array(array($this->handler, $method), $args); |
312 |
| - } |
313 |
| -} |
|
0 commit comments