/** * @param ResolvedFormTypeInterface|null $formType * @param array &$types */ public static function typeAncestryForType(ResolvedFormTypeInterface $formType = null, array &$types) { if (!$formType instanceof ResolvedFormTypeInterface) { return; } $types[] = get_class($formType->getInnerType()); self::typeAncestryForType($formType->getParent(), $types); }
/** * Check if the parent type of the current type is allowed. * * @param string[] $types The class name of types * @param ResolvedFormTypeInterface $rType The resolved form type * * @return bool */ protected static function isType(array $types, ResolvedFormTypeInterface $rType = null) { if (null === $rType) { return false; } elseif (!in_array(get_class($rType->getInnerType()), $types)) { return static::isType($types, $rType->getParent()); } return true; }
/** * {@inheritdoc} */ public function getInnerType() { return $this->proxiedType->getInnerType(); }