private function parseNamespace($tokens)
    {
        $namespace = null;
        $tokenCount = count($tokens);
        for ($offset=0; $offset < $tokenCount; $offset++) {
            if (!is_array($tokens[$offset])) {
                continue;
            }

            if (T_NAMESPACE === $tokens[$offset][0]) {
                $offset++; // the next token is a whitespace

                return $this->parseNamespaceString($tokens, $offset);
            }
        }

        return $namespace;
    }
private function parseNamespace($tokens)
    {
        $namespace = null;
        $tokenCount = count($tokens);
        for ($offset=0; $offset < $tokenCount; $offset++) {
            if (!is_array($tokens[$offset])) {
                continue;
            }

            if (T_NAMESPACE === $tokens[$offset][0]) {
                $offset++; // the next token is a whitespace

                return $this->parseNamespaceString($tokens, $offset);
            }
        }

        return $namespace;
    }
private function parseNamespace ( $ tokens ) { $ namespace = null ; $ tokenCount = count ( $ tokens ) ; for ( $ offset = 0 ; $ offset < $ tokenCount ; $ offset ++ ) { if ( ! is_array ( $ tokens [ $ offset ] ) ) { continue ; } if ( T_NAMESPACE === $ tokens [ $ offset ] [ 0 ] ) { $ offset ++ ; // the next token is a whitespace return $ this -> parseNamespaceString ( $ tokens , $ offset ) ; } } return $ namespace ; }
Extracts the namespace from tokenized file
@param array $tokens
@return string|null the classname or null
Extracts the namespace from tokenized file