Skip to content

Commit

Permalink
[FrameworkBundle] changed Client::enableProfiler() behavior to fail s…
Browse files Browse the repository at this point in the history
…ilently when the profiler is not available (it makes it easier to write functional tests)
  • Loading branch information
fabpot committed Sep 18, 2012
1 parent f41872b commit bafe890
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/Symfony/Bundle/FrameworkBundle/Client.php
Expand Up @@ -65,15 +65,13 @@ public function getProfile()
/**
* 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;
}

/**
Expand Down

0 comments on commit bafe890

Please sign in to comment.