From 2ea10b46780cb470218e64e4b530f5a411276a7b Mon Sep 17 00:00:00 2001 From: Minh-Quan TRAN Date: Wed, 30 Jan 2019 18:01:47 +0100 Subject: [PATCH] Raise deprecation notice when the controller definition starts with \ Signed-off-by: Minh-Quan TRAN --- .../HttpKernel/Controller/ContainerControllerResolver.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Symfony/Component/HttpKernel/Controller/ContainerControllerResolver.php b/src/Symfony/Component/HttpKernel/Controller/ContainerControllerResolver.php index 4f80921cf58f4..af9f3264c26fa 100644 --- a/src/Symfony/Component/HttpKernel/Controller/ContainerControllerResolver.php +++ b/src/Symfony/Component/HttpKernel/Controller/ContainerControllerResolver.php @@ -54,6 +54,9 @@ protected function instantiateController($class) try { return parent::instantiateController($class); } catch (\Error $e) { + if (0 === strpos($class, '\\')) { + @trigger_error(sprintf('The controller definition "%s" must not begin with "\"', $class), E_USER_DEPRECATED); + } } $this->throwExceptionIfControllerWasRemoved($class, $e);