Skip to content

Commit bafe890

Browse files
committed
[FrameworkBundle] changed Client::enableProfiler() behavior to fail silently when the profiler is not available (it makes it easier to write functional tests)
1 parent f41872b commit bafe890

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/Symfony/Bundle/FrameworkBundle/Client.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,13 @@ public function getProfile()
6565
/**
6666
* Enables the profiler for the very next request.
6767
*
68-
* @throws \LogicException if the profiler is not configured in the service container
68+
* If the profiler is not enabled, the call to this method does nothing.
6969
*/
7070
public function enableProfiler()
7171
{
72-
if (!$this->kernel->getContainer()->has('profiler')) {
73-
throw new \LogicException('You cannot enable the profiler as it is not configured in the service container.');
72+
if ($this->kernel->getContainer()->has('profiler')) {
73+
$this->profiler = true;
7474
}
75-
76-
$this->profiler = true;
7775
}
7876

7977
/**

0 commit comments

Comments
 (0)