src/Service/Tokenlist.php
public function getNamespace()
    {
        $class       = array();
        $inNamespace = false;

        foreach ($this->tokenlist as $key => $token) {
            if (T_NAMESPACE === $token[0]) {
                $inNamespace = true;
                continue;
            }
            if (T_STRING === $token[0] && $inNamespace) {
                $class[] = $token[1];

            }
            if (';' === $token && $inNamespace) {
                return $class;
            }
        }

        return array();
    }
public function getNamespace()
    {
        $class       = array();
        $inNamespace = false;

        foreach ($this->tokenlist as $key => $token) {
            if (T_NAMESPACE === $token[0]) {
                $inNamespace = true;
                continue;
            }
            if (T_STRING === $token[0] && $inNamespace) {
                $class[] = $token[1];

            }
            if (';' === $token && $inNamespace) {
                return $class;
            }
        }

        return array();
    }
public function getNamespace ( ) { $ class = array ( ) ; $ inNamespace = false ; foreach ( $ this -> tokenlist as $ key => $ token ) { if ( T_NAMESPACE === $ token [ 0 ] ) { $ inNamespace = true ; continue ; } if ( T_STRING === $ token [ 0 ] && $ inNamespace ) { $ class [ ] = $ token [ 1 ] ; } if ( ';' === $ token && $ inNamespace ) { return $ class ; } } return array ( ) ; }
Get the first namespace of the given content

@return array
Get the first namespace of the given content