public static function isTypeInAncestry(FormInterface $form, $type) { return in_array($type, self::typeAncestry($form)); }
public function interactWith(FormInterface $form, HelperSet $helperSet, InputInterface $input, OutputInterface $output) { if (FormUtil::isTypeInAncestry($form, 'button')) { throw new NoNeedToInteractWithForm(); } // by default, we let another interactor interact with this form throw new CanNotInteractWithForm(); }