[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:
parent
f41872b907
commit
bafe89047f
@ -65,16 +65,14 @@ 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;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Makes a request.
|
||||
|
Reference in New Issue
Block a user