/** * Parses the signature of a class. * * 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. * * @return \PDepend\Source\AST\ASTClass * @since 1.0.0 */ private 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->setDocComment($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; }