Skip to content

Commit 59c4f55

Browse files
committed
a few minor changes
1 parent ff4d446 commit 59c4f55

File tree

3 files changed

+10
-11
lines changed

3 files changed

+10
-11
lines changed

src/Symfony/Component/Form/Extension/Validator/Constraints/FormValidator.php

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,18 +47,17 @@ public function validate($form, Constraint $constraint)
4747
}
4848

4949
/* @var FormInterface $form */
50-
51-
$path = $this->context->getPropertyPath();
52-
$graphWalker = $this->context->getGraphWalker();
53-
$groups = $this->getValidationGroups($form);
5450
$config = $form->getConfig();
5551

56-
if (!empty($path)) {
57-
$path .= '.';
58-
}
59-
6052
if ($form->isSynchronized()) {
6153
// Validate the form data only if transformation succeeded
54+
$path = $this->context->getPropertyPath();
55+
$graphWalker = $this->context->getGraphWalker();
56+
$groups = $this->getValidationGroups($form);
57+
58+
if (!empty($path)) {
59+
$path .= '.';
60+
}
6261

6362
// Validate the data against its own constraints
6463
if (self::allowDataWalking($form)) {

src/Symfony/Component/Form/Extension/Validator/ViolationMapper/MappingRule.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,15 @@ public function getOrigin()
5858
*
5959
* @param string $propertyPath The property path to match against the rule.
6060
*
61-
* @return Boolean|FormInterface The mapped form or false.
61+
* @return null|FormInterface The mapped form or null.
6262
*/
6363
public function match($propertyPath)
6464
{
6565
if ($propertyPath === (string) $this->propertyPath) {
6666
return $this->getTarget();
6767
}
6868

69-
return false;
69+
return null;
7070
}
7171

7272
/**

src/Symfony/Component/Form/Extension/Validator/ViolationMapper/ViolationMapper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ private function matchChild(PropertyPathIteratorInterface $it)
164164
/* @var MappingRule $rule */
165165

166166
// Mapping rule matches completely, terminate.
167-
if (false !== ($form = $rule->match($chunk))) {
167+
if (null !== ($form = $rule->match($chunk))) {
168168
return $form;
169169
}
170170

0 commit comments

Comments
 (0)