@@ -26,10 +26,10 @@ class FormValidator extends ConstraintValidator
2626 /**
2727 * {@inheritdoc}
2828 */
29- public function validate ($ form , Constraint $ constraint )
29+ public function validate ($ form , Constraint $ formConstraint )
3030 {
31- if (!$ constraint instanceof Form) {
32- throw new UnexpectedTypeException ($ constraint , __NAMESPACE__ .'\Form ' );
31+ if (!$ formConstraint instanceof Form) {
32+ throw new UnexpectedTypeException ($ formConstraint , __NAMESPACE__ .'\Form ' );
3333 }
3434
3535 if (!$ form instanceof FormInterface) {
@@ -62,8 +62,8 @@ public function validate($form, Constraint $constraint)
6262 // Otherwise validate a constraint only once for the first
6363 // matching group
6464 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 );
6767 if (\count ($ this ->context ->getViolations ()) > 0 ) {
6868 break ;
6969 }
@@ -113,7 +113,7 @@ public function validate($form, Constraint $constraint)
113113 ? (string ) $ form ->getViewData ()
114114 : \gettype ($ form ->getViewData ());
115115
116- $ this ->context ->setConstraint ($ constraint );
116+ $ this ->context ->setConstraint ($ formConstraint );
117117 $ this ->context ->buildViolation ($ config ->getOption ('invalid_message ' ))
118118 ->setParameters (array_replace (['{{ value }} ' => $ clientDataAsString ], $ config ->getOption ('invalid_message_parameters ' )))
119119 ->setInvalidValue ($ form ->getViewData ())
@@ -125,7 +125,7 @@ public function validate($form, Constraint $constraint)
125125
126126 // Mark the form with an error if it contains extra fields
127127 if (!$ config ->getOption ('allow_extra_fields ' ) && \count ($ form ->getExtraData ()) > 0 ) {
128- $ this ->context ->setConstraint ($ constraint );
128+ $ this ->context ->setConstraint ($ formConstraint );
129129 $ this ->context ->buildViolation ($ config ->getOption ('extra_fields_message ' ))
130130 ->setParameter ('{{ extra_fields }} ' , '" ' .implode ('", " ' , array_keys ($ form ->getExtraData ())).'" ' )
131131 ->setInvalidValue ($ form ->getExtraData ())
0 commit comments