@@ -26,10 +26,10 @@ class FormValidator extends ConstraintValidator
26
26
/**
27
27
* {@inheritdoc}
28
28
*/
29
- public function validate ($ form , Constraint $ constraint )
29
+ public function validate ($ form , Constraint $ formConstraint )
30
30
{
31
- if (!$ constraint instanceof Form) {
32
- throw new UnexpectedTypeException ($ constraint , __NAMESPACE__ .'\Form ' );
31
+ if (!$ formConstraint instanceof Form) {
32
+ throw new UnexpectedTypeException ($ formConstraint , __NAMESPACE__ .'\Form ' );
33
33
}
34
34
35
35
if (!$ form instanceof FormInterface) {
@@ -62,8 +62,8 @@ public function validate($form, Constraint $constraint)
62
62
// Otherwise validate a constraint only once for the first
63
63
// matching group
64
64
foreach ($ groups as $ group ) {
65
- if (\in_array ($ group , $ constraint ->groups )) {
66
- $ validator ->atPath ('data ' )->validate ($ form ->getData (), $ constraint , $ group );
65
+ if (\in_array ($ group , $ formConstraint ->groups )) {
66
+ $ validator ->atPath ('data ' )->validate ($ form ->getData (), $ formConstraint , $ group );
67
67
if (\count ($ this ->context ->getViolations ()) > 0 ) {
68
68
break ;
69
69
}
@@ -113,7 +113,7 @@ public function validate($form, Constraint $constraint)
113
113
? (string ) $ form ->getViewData ()
114
114
: \gettype ($ form ->getViewData ());
115
115
116
- $ this ->context ->setConstraint ($ constraint );
116
+ $ this ->context ->setConstraint ($ formConstraint );
117
117
$ this ->context ->buildViolation ($ config ->getOption ('invalid_message ' ))
118
118
->setParameters (array_replace (['{{ value }} ' => $ clientDataAsString ], $ config ->getOption ('invalid_message_parameters ' )))
119
119
->setInvalidValue ($ form ->getViewData ())
@@ -125,7 +125,7 @@ public function validate($form, Constraint $constraint)
125
125
126
126
// Mark the form with an error if it contains extra fields
127
127
if (!$ config ->getOption ('allow_extra_fields ' ) && \count ($ form ->getExtraData ()) > 0 ) {
128
- $ this ->context ->setConstraint ($ constraint );
128
+ $ this ->context ->setConstraint ($ formConstraint );
129
129
$ this ->context ->buildViolation ($ config ->getOption ('extra_fields_message ' ))
130
130
->setParameter ('{{ extra_fields }} ' , '" ' .implode ('", " ' , array_keys ($ form ->getExtraData ())).'" ' )
131
131
->setInvalidValue ($ form ->getExtraData ())
0 commit comments