PHPMD\Node\MethodNode::getParentType PHP Method

getParentType() public method

Returns the parent class or interface instance.
public getParentType ( ) : PHPMD\Node\AbstractTypeNode
return PHPMD\Node\AbstractTypeNode
    public function getParentType()
    {
        $parentNode = $this->getNode()->getParent();
        if ($parentNode instanceof ASTTrait) {
            return new TraitNode($parentNode);
        }
        if ($parentNode instanceof ASTClass) {
            return new ClassNode($parentNode);
        }
        return new InterfaceNode($parentNode);
    }