You are here

public function PHP_Token_NAMESPACE::getName in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/phpunit/php-token-stream/src/Token.php \PHP_Token_NAMESPACE::getName()

Return value

string

File

vendor/phpunit/php-token-stream/src/Token.php, line 780

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;
}