public function interactWith(FormInterface $form, HelperSet $helperSet, InputInterface $input, OutputInterface $output)
{
if (!$input->isInteractive()) {
throw new CanNotInteractWithForm('This interactor only works with interactive input');
}
if (!FormUtil::isCompound($form)) {
throw new CanNotInteractWithForm('Expected a compound form');
}
$submittedData = [];
foreach ($form->all() as $name => $field) {
try {
$submittedData[$name] = $this->formInteractor->interactWith($field, $helperSet, $input, $output);
} catch (NoNeedToInteractWithForm $exception) {
continue;
}
}
return $submittedData;
}