private function getClassType($node, TypeInterface $parent): string
    {
        $phpFile = RootRetrieverHelper::getRoot($parent);

        switch (true) {
            case $node instanceof Node\Identifier:
            case $node->isRelative():
            case $node->isUnqualified():
                $name = $this->getUnqualifiedClassType($node, $phpFile);
                break;
            case $node->isFullyQualified():
                $name = $node->toString();
                break;
            case $node->isQualified():
                $name = $this->getQualifiedClassType($node, $phpFile);
                break;
            default:
                return TypeInterface::UNKNOWN_CUSTOM;
        }

        // Get the last name part
        $nameArray = explode('\\', $name);
        $lastPart  = end($nameArray);

        $phpFile->addConcreteUse($name, $lastPart);

        return $lastPart;
    }
private function getClassType($node, TypeInterface $parent): string
    {
        $phpFile = RootRetrieverHelper::getRoot($parent);

        switch (true) {
            case $node instanceof Node\Identifier:
            case $node->isRelative():
            case $node->isUnqualified():
                $name = $this->getUnqualifiedClassType($node, $phpFile);
                break;
            case $node->isFullyQualified():
                $name = $node->toString();
                break;
            case $node->isQualified():
                $name = $this->getQualifiedClassType($node, $phpFile);
                break;
            default:
                return TypeInterface::UNKNOWN_CUSTOM;
        }

        // Get the last name part
        $nameArray = explode('\\', $name);
        $lastPart  = end($nameArray);

        $phpFile->addConcreteUse($name, $lastPart);

        return $lastPart;
    }
private function getClassType ( $ node , TypeInterface $ parent ) : string { $ phpFile = RootRetrieverHelper :: getRoot ( $ parent ) ; switch ( true ) { case $ node instanceof Node \ Identifier : case $ node -> isRelative ( ) : case $ node -> isUnqualified ( ) : $ name = $ this -> getUnqualifiedClassType ( $ node , $ phpFile ) ; break ; case $ node -> isFullyQualified ( ) : $ name = $ node -> toString ( ) ; break ; case $ node -> isQualified ( ) : $ name = $ this -> getQualifiedClassType ( $ node , $ phpFile ) ; break ; default : return TypeInterface :: UNKNOWN_CUSTOM ; } // Get the last name part $ nameArray = explode ( '\\' , $ name ) ; $ lastPart = end ( $ nameArray ) ; $ phpFile -> addConcreteUse ( $ name , $ lastPart ) ; return $ lastPart ; }
Get the class type hint as a string.

@param Node\Name|Node\Identifier $node   The name node to parse.
@param TypeInterface             $parent The parent to update.

@return string The class type hint.
Get the class type hint as a string .