src/Reflection/ReflectionClass.php
private function parseNamespace($loc): string
    {
        $tokens = $this->getTokenStream();
        $ns     = '';

        if (\in_array($this->tokens->type($loc), [T_FUNCTION, T_CONST])) {
            $ns .= $this->tokens->value($loc) . ' ';
            $loc = $tokens->next($loc);
        }

        while (\in_array($tokens->type($loc), [T_NS_SEPARATOR, T_STRING])) {
            $ns .= $tokens->value($loc);
            $loc = $tokens->next($loc);
        }

        return $ns;
    }
private function parseNamespace($loc): string
    {
        $tokens = $this->getTokenStream();
        $ns     = '';

        if (\in_array($this->tokens->type($loc), [T_FUNCTION, T_CONST])) {
            $ns .= $this->tokens->value($loc) . ' ';
            $loc = $tokens->next($loc);
        }

        while (\in_array($tokens->type($loc), [T_NS_SEPARATOR, T_STRING])) {
            $ns .= $tokens->value($loc);
            $loc = $tokens->next($loc);
        }

        return $ns;
    }
private function parseNamespace ( $ loc ) : string { $ tokens = $ this -> getTokenStream ( ) ; $ ns = '' ; if ( \ in_array ( $ this -> tokens -> type ( $ loc ) , [ T_FUNCTION , T_CONST ] ) ) { $ ns .= $ this -> tokens -> value ( $ loc ) . ' ' ; $ loc = $ tokens -> next ( $ loc ) ; } while ( \ in_array ( $ tokens -> type ( $ loc ) , [ T_NS_SEPARATOR , T_STRING ] ) ) { $ ns .= $ tokens -> value ( $ loc ) ; $ loc = $ tokens -> next ( $ loc ) ; } return $ ns ; }
Parse the namespace and return as string

@param int $loc location of the first namespace token (T_STRING)
and not the T_NAMESPACE, T_AS or T_USE.

@return string
Parse the namespace and return as string