You are here

public function PHP_Token_INTERFACE::getParent in Zircon Profile 8

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

Return value

boolean|string

File

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

Class

PHP_Token_INTERFACE

Code

public function getParent() {
  if (!$this
    ->hasParent()) {
    return false;
  }
  $i = $this->id + 6;
  $tokens = $this->tokenStream
    ->tokens();
  $className = (string) $tokens[$i];
  while (isset($tokens[$i + 1]) && !$tokens[$i + 1] instanceof PHP_Token_WHITESPACE) {
    $className .= (string) $tokens[++$i];
  }
  return $className;
}