[FrameworkBundle] changed Client::enableProfiler() behavior to fail silently when the profiler is not available (it makes it easier to write functional tests)

This commit is contained in:
Fabien Potencier 2012-09-18 16:33:46 +02:00
parent f41872b907
commit bafe89047f

View File

@ -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;
}
/**