diff --git a/src/Symfony/Component/Form/Extension/Validator/Constraints/FormValidator.php b/src/Symfony/Component/Form/Extension/Validator/Constraints/FormValidator.php index 81da771bd9..88d2cfbc11 100644 --- a/src/Symfony/Component/Form/Extension/Validator/Constraints/FormValidator.php +++ b/src/Symfony/Component/Form/Extension/Validator/Constraints/FormValidator.php @@ -47,18 +47,17 @@ class FormValidator extends ConstraintValidator } /* @var FormInterface $form */ - - $path = $this->context->getPropertyPath(); - $graphWalker = $this->context->getGraphWalker(); - $groups = $this->getValidationGroups($form); $config = $form->getConfig(); - if (!empty($path)) { - $path .= '.'; - } - if ($form->isSynchronized()) { // Validate the form data only if transformation succeeded + $path = $this->context->getPropertyPath(); + $graphWalker = $this->context->getGraphWalker(); + $groups = $this->getValidationGroups($form); + + if (!empty($path)) { + $path .= '.'; + } // Validate the data against its own constraints if (self::allowDataWalking($form)) { diff --git a/src/Symfony/Component/Form/Extension/Validator/ViolationMapper/MappingRule.php b/src/Symfony/Component/Form/Extension/Validator/ViolationMapper/MappingRule.php index 9c87b96c54..eef8b0eb54 100644 --- a/src/Symfony/Component/Form/Extension/Validator/ViolationMapper/MappingRule.php +++ b/src/Symfony/Component/Form/Extension/Validator/ViolationMapper/MappingRule.php @@ -58,7 +58,7 @@ class MappingRule * * @param string $propertyPath The property path to match against the rule. * - * @return Boolean|FormInterface The mapped form or false. + * @return null|FormInterface The mapped form or null. */ public function match($propertyPath) { @@ -66,7 +66,7 @@ class MappingRule return $this->getTarget(); } - return false; + return null; } /** diff --git a/src/Symfony/Component/Form/Extension/Validator/ViolationMapper/ViolationMapper.php b/src/Symfony/Component/Form/Extension/Validator/ViolationMapper/ViolationMapper.php index ddf061d454..86daab7b43 100644 --- a/src/Symfony/Component/Form/Extension/Validator/ViolationMapper/ViolationMapper.php +++ b/src/Symfony/Component/Form/Extension/Validator/ViolationMapper/ViolationMapper.php @@ -164,7 +164,7 @@ class ViolationMapper implements ViolationMapperInterface /* @var MappingRule $rule */ // Mapping rule matches completely, terminate. - if (false !== ($form = $rule->match($chunk))) { + if (null !== ($form = $rule->match($chunk))) { return $form; }