original_string: public function validateForm(FormEvent $event)
      {
          $form = $event->getForm();
  
          if ($form->isRoot()) {
              // Form groups are validated internally (FormValidator). Here we don't set groups as they are retrieved into the validator.
              foreach ($this->validator->validate($form) as $violation) {
                  // Allow the "invalid" constraint to be put onto
                  // non-synchronized forms
                  // ConstraintViolation::getConstraint() must not expect to provide a constraint as long as Symfony\Component\Validator\ExecutionContext exists (before 3.0)
                  $allowNonSynchronized = (null === $violation->getConstraint() || $violation->getConstraint() instanceof Form) && Form::NOT_SYNCHRONIZED_ERROR === $violation->getCode();
  
                  $this->violationMapper->mapViolation($violation, $form, $allowNonSynchronized);
              }
          }
      }
code: public function validateForm(FormEvent $event)
      {
          $form = $event->getForm();
  
          if ($form->isRoot()) {
              // Form groups are validated internally (FormValidator). Here we don't set groups as they are retrieved into the validator.
              foreach ($this->validator->validate($form) as $violation) {
                  // Allow the "invalid" constraint to be put onto
                  // non-synchronized forms
                  // ConstraintViolation::getConstraint() must not expect to provide a constraint as long as Symfony\Component\Validator\ExecutionContext exists (before 3.0)
                  $allowNonSynchronized = (null === $violation->getConstraint() || $violation->getConstraint() instanceof Form) && Form::NOT_SYNCHRONIZED_ERROR === $violation->getCode();
  
                  $this->violationMapper->mapViolation($violation, $form, $allowNonSynchronized);
              }
          }
      }
code_tokens: public function validateForm ( FormEvent $ event ) { $ form = $ event -> getForm ( ) ; if ( $ form -> isRoot ( ) ) { // Form groups are validated internally (FormValidator). Here we don't set groups as they are retrieved into the validator. foreach ( $ this -> validator -> validate ( $ form ) as $ violation ) { // Allow the "invalid" constraint to be put onto // non-synchronized forms // ConstraintViolation::getConstraint() must not expect to provide a constraint as long as Symfony\Component\Validator\ExecutionContext exists (before 3.0) $ allowNonSynchronized = ( null === $ violation -> getConstraint ( ) || $ violation -> getConstraint ( ) instanceof Form ) && Form :: NOT_SYNCHRONIZED_ERROR === $ violation -> getCode ( ) ; $ this -> violationMapper -> mapViolation ( $ violation , $ form , $ allowNonSynchronized ) ; } } }
docstring: Validates the form and its domain object.
  
  @param FormEvent $event The event object
docstring_tokens: Validates the form and its domain object .