src/Reflection/ReflectionFile.php
private function activeNamespace(int $tokenID): string
    {
        foreach ($this->namespaces as $namespace => $position) {
            if ($tokenID >= $position[self::O_TOKEN] && $tokenID <= $position[self::C_TOKEN]) {
                return $namespace;
            }
        }

        //Seems like no namespace declaration
        $this->namespaces[''] = [
            self::O_TOKEN => 0,
            self::C_TOKEN => count($this->tokens),
            self::N_USES  => [],
        ];

        return '';
    }
private function activeNamespace(int $tokenID): string
    {
        foreach ($this->namespaces as $namespace => $position) {
            if ($tokenID >= $position[self::O_TOKEN] && $tokenID <= $position[self::C_TOKEN]) {
                return $namespace;
            }
        }

        //Seems like no namespace declaration
        $this->namespaces[''] = [
            self::O_TOKEN => 0,
            self::C_TOKEN => count($this->tokens),
            self::N_USES  => [],
        ];

        return '';
    }
private function activeNamespace ( int $ tokenID ) : string { foreach ( $ this -> namespaces as $ namespace => $ position ) { if ( $ tokenID >= $ position [ self :: O_TOKEN ] && $ tokenID <= $ position [ self :: C_TOKEN ] ) { return $ namespace ; } } //Seems like no namespace declaration $ this -> namespaces [ '' ] = [ self :: O_TOKEN => 0 , self :: C_TOKEN => count ( $ this -> tokens ) , self :: N_USES => [ ] , ] ; return '' ; }
Get namespace name active at specified token position.

@param int $tokenID

@return string
Get namespace name active at specified token position .