if (!
$form instanceof FormInterface
) { return;
} /* @var FormInterface $form */
$config =
$form->
getConfig();
$validator =
$this->context->
getValidator()->
inContext($this->context
);
if ($form->
isSubmitted() &&
$form->
isSynchronized()) { // Validate the form data only if transformation succeeded
$groups =
$this->
getValidationGroups($form);
if (!
$groups) { return;
} $data =
$form->
getData();
// Validate the data against its own constraints
$validateDataGraph =
$form->
isRoot() && (\
is_object($data) || \
is_array($data)) && (($groups && \
is_array($groups)) || ($groups instanceof GroupSequence &&
$groups->groups
)) ;