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

parseQualifiedNameRaw() private method

This method parses a qualified PHP 5.3 class, interface and namespace identifier and returns the collected tokens as a string array.
Since: 0.9.5
private parseQualifiedNameRaw ( ) : array(string)
return array(string)
    private function parseQualifiedNameRaw()
    {
        // Reset namespace prefix flag
        $this->namespacePrefixReplaced = false;
        // Consume comments and fetch first token type
        $this->consumeComments();
        $tokenType = $this->tokenizer->peek();
        $qualifiedName = array();
        if ($tokenType === Tokens::T_NAMESPACE) {
            // Consume namespace keyword
            $this->consumeToken(Tokens::T_NAMESPACE);
            $this->consumeComments();
            // Add current namespace as first token
            $qualifiedName = array((string) $this->namespaceName);
            // Set prefixed flag to true
            $this->namespacePrefixReplaced = true;
        } elseif ($this->isClassName($tokenType)) {
            $qualifiedName[] = $this->parseClassName();
            $this->consumeComments();
            $tokenType = $this->tokenizer->peek();
            // Stop here for simple identifier
            if ($tokenType !== Tokens::T_BACKSLASH) {
                return $qualifiedName;
            }
        }
        do {
            // Next token must be a namespace separator
            $this->consumeToken(Tokens::T_BACKSLASH);
            $this->consumeComments();
            // Append to qualified name
            $qualifiedName[] = '\\';
            $qualifiedName[] = $this->parseClassName();
            $this->consumeComments();
            // Get next token type
            $tokenType = $this->tokenizer->peek();
        } while ($tokenType === Tokens::T_BACKSLASH);
        return $qualifiedName;
    }
AbstractPHPParser