minor #17364 [Bridge] [Doctrine] Normalize params only when used. [2.3] (SpacePossum)

This PR was merged into the 2.3 branch.

Discussion
----------

[Bridge] [Doctrine] Normalize params only when used. [2.3]

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| License       | MIT

If no logger is set the params are not used so those don't have to be normalized.

Commits
-------

6852a46 Normalize params only when used.
This commit is contained in:
Fabien Potencier 2016-01-15 17:58:40 +01:00
commit 9d189137e3
1 changed files with 1 additions and 5 deletions

View File

@ -49,12 +49,8 @@ class DbalLogger implements SQLLogger
$this->stopwatch->start('doctrine', 'doctrine');
}
if (is_array($params)) {
$params = $this->normalizeParams($params);
}
if (null !== $this->logger) {
$this->log($sql, null === $params ? array() : $params);
$this->log($sql, null === $params ? array() : $this->normalizeParams($params));
}
}