From a4d2d31f1bcd0df697df4d728839351a4a2cd6b7 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Fri, 31 Jul 2015 16:29:19 +0200 Subject: [PATCH] [Debug] Deprecate ExceptionHandler::createResponse --- src/Symfony/Component/Debug/ExceptionHandler.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Symfony/Component/Debug/ExceptionHandler.php b/src/Symfony/Component/Debug/ExceptionHandler.php index 027b66c052..257ad4460c 100644 --- a/src/Symfony/Component/Debug/ExceptionHandler.php +++ b/src/Symfony/Component/Debug/ExceptionHandler.php @@ -164,6 +164,7 @@ class ExceptionHandler $response = $this->createResponse($exception); $response->sendHeaders(); $response->sendContent(); + @trigger_error(sprintf("The %s::createResponse method is deprecated since 2.8 and won't be called anymore when handling an exception in 3.0.", $reflector->class), E_USER_DEPRECATED); return; } @@ -202,9 +203,13 @@ class ExceptionHandler * @param \Exception|FlattenException $exception An \Exception instance * * @return Response A Response instance + * + * @deprecated since 2.8, to be removed in 3.0. */ public function createResponse($exception) { + @trigger_error('The '.__METHOD__.' method is deprecated since version 2.8 and will be removed in 3.0.', E_USER_DEPRECATED); + if (!$exception instanceof FlattenException) { $exception = FlattenException::create($exception); }