Skip to content

Commit 5fffdd7

Browse files
committed
Merge branch '3.0'
* 3.0: (36 commits) Fixed form types in profiler [Process] Use stream based storage to avoid memory issues Fix upgrade guides concerning erroneous removal of assets helper [Process] Remove a misleading comment Fix markdown typo ChooseBaseUrl should return an index [Form] ChoiceType: Fix a notice when 'choices' normalizer is replaced Improve the phpdoc of SplFileInfo methods [Process] Use stream based storage to avoid memory issues [FrameworkBundle] Don't log twice with the error handler synchronize 2.8 and 3.0 upgrade files Remove useless is_object condition [Process] Fix typo, no arguments needed anymore [Serializer] Introduce constants for context keys Fixed the documentation of VoterInterface::supportsAttribute Fixed Bootstrap form theme form "reset" buttons Fixed the form profiler when using long form types [PropertyInfo] PhpDocExtractor: Fix a notice when the property doesn't exist Remove useless duplicated tests [FrameworkBundle] Optimize framework extension tests ...
2 parents 089971a + 609b902 commit 5fffdd7

File tree

2 files changed

+5
-17
lines changed

2 files changed

+5
-17
lines changed

Logger/DbalLogger.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,8 @@ public function startQuery($sql, array $params = null, array $types = null)
4949
$this->stopwatch->start('doctrine', 'doctrine');
5050
}
5151

52-
if (is_array($params)) {
53-
$params = $this->normalizeParams($params);
54-
}
55-
5652
if (null !== $this->logger) {
57-
$this->log($sql, null === $params ? array() : $params);
53+
$this->log($sql, null === $params ? array() : $this->normalizeParams($params));
5854
}
5955
}
6056

Validator/Constraints/UniqueEntityValidator.php

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
namespace Symfony\Bridge\Doctrine\Validator\Constraints;
1313

1414
use Doctrine\Common\Persistence\ManagerRegistry;
15-
use Symfony\Component\Validator\Context\ExecutionContextInterface;
1615
use Symfony\Component\Validator\Constraint;
1716
use Symfony\Component\Validator\Exception\UnexpectedTypeException;
1817
use Symfony\Component\Validator\Exception\ConstraintDefinitionException;
@@ -139,16 +138,9 @@ public function validate($entity, Constraint $constraint)
139138
$errorPath = null !== $constraint->errorPath ? $constraint->errorPath : $fields[0];
140139
$invalidValue = isset($criteria[$errorPath]) ? $criteria[$errorPath] : $criteria[$fields[0]];
141140

142-
if ($this->context instanceof ExecutionContextInterface) {
143-
$this->context->buildViolation($constraint->message)
144-
->atPath($errorPath)
145-
->setInvalidValue($invalidValue)
146-
->addViolation();
147-
} else {
148-
$this->buildViolation($constraint->message)
149-
->atPath($errorPath)
150-
->setInvalidValue($invalidValue)
151-
->addViolation();
152-
}
141+
$this->context->buildViolation($constraint->message)
142+
->atPath($errorPath)
143+
->setInvalidValue($invalidValue)
144+
->addViolation();
153145
}
154146
}

0 commit comments

Comments
 (0)