From bafe89047fbad1dc12cde5e3b0a62de651cf6bfb Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Tue, 18 Sep 2012 16:33:46 +0200 Subject: [PATCH] [FrameworkBundle] changed Client::enableProfiler() behavior to fail silently when the profiler is not available (it makes it easier to write functional tests) --- src/Symfony/Bundle/FrameworkBundle/Client.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/Client.php b/src/Symfony/Bundle/FrameworkBundle/Client.php index 3874573f90..ec4e4aa647 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Client.php +++ b/src/Symfony/Bundle/FrameworkBundle/Client.php @@ -65,15 +65,13 @@ class Client extends BaseClient /** * Enables the profiler for the very next request. * - * @throws \LogicException if the profiler is not configured in the service container + * If the profiler is not enabled, the call to this method does nothing. */ public function enableProfiler() { - if (!$this->kernel->getContainer()->has('profiler')) { - throw new \LogicException('You cannot enable the profiler as it is not configured in the service container.'); + if ($this->kernel->getContainer()->has('profiler')) { + $this->profiler = true; } - - $this->profiler = true; } /**