private function getTypeObject($type, $args)
    {
        /* @var AbstractType $object */
        if ($type instanceof AbstractType) {
            $object = $type;
        } else {
            $class = $this->getTypeClass($type);

            if (!\class_exists($class)) {
                $class = TextType::class;
            }

            $object = new $class($args, $this);
        }

        return $object;
    }
private function getTypeObject($type, $args)
    {
        /* @var AbstractType $object */
        if ($type instanceof AbstractType) {
            $object = $type;
        } else {
            $class = $this->getTypeClass($type);

            if (!\class_exists($class)) {
                $class = TextType::class;
            }

            $object = new $class($args, $this);
        }

        return $object;
    }
private function getTypeObject ( $ type , $ args ) { /* @var AbstractType $object */ if ( $ type instanceof AbstractType ) { $ object = $ type ; } else { $ class = $ this -> getTypeClass ( $ type ) ; if ( ! \ class_exists ( $ class ) ) { $ class = TextType :: class ; } $ object = new $ class ( $ args , $ this ) ; } return $ object ; }
Returns a new instance of the given form type.

@param string $type FQCN of the form type or short hand e.g 'text', 'email'.
@param array  $args Arguments to pass to the type class constructor.

@return AbstractType
Returns a new instance of the given form type .