public function PHP_Token_NAMESPACE::getName

File

drupal/core/vendor/phpunit/php-token-stream/PHP/Token.php, line 668

Class

PHP_Token_NAMESPACE

Code

public function getName() {
  $tokens = $this->tokenStream
    ->tokens();
  $namespace = (string) $tokens[$this->id + 2];
  for ($i = $this->id + 3;; $i += 2) {
    if (isset($tokens[$i]) && $tokens[$i] instanceof PHP_Token_NS_SEPARATOR) {
      $namespace .= '\\' . $tokens[$i + 1];
    }
    else {
      break;
    }
  }
  return $namespace;
}