PDepend\Source\Language\PHP\AbstractPHPParser::parseClassSignature PHP Method

parseClassSignature() protected method

The signature of a class consists of optional class modifiers like, final or abstract, the T_CLASS token, the class name, an optional parent class and an optional list of implemented interfaces.
Since: 1.0.0
protected parseClassSignature ( ) : PDepend\Source\AST\ASTClass
return PDepend\Source\AST\ASTClass
    protected function parseClassSignature()
    {
        $this->parseClassModifiers();
        $this->consumeToken(Tokens::T_CLASS);
        $this->consumeComments();
        $qualifiedName = $this->createQualifiedTypeName($this->parseClassName());
        $class = $this->builder->buildClass($qualifiedName);
        $class->setCompilationUnit($this->compilationUnit);
        $class->setModifiers($this->modifiers);
        $class->setComment($this->docComment);
        $class->setId($this->idBuilder->forClassOrInterface($class));
        $class->setUserDefined();
        $this->consumeComments();
        $tokenType = $this->tokenizer->peek();
        if ($tokenType === Tokens::T_EXTENDS) {
            $class = $this->parseClassExtends($class);
            $this->consumeComments();
            $tokenType = $this->tokenizer->peek();
        }
        if ($tokenType === Tokens::T_IMPLEMENTS) {
            $this->consumeToken(Tokens::T_IMPLEMENTS);
            $this->parseInterfaceList($class);
        }
        return $class;
    }
AbstractPHPParser