public function PHP_Token_Includes::getName

1 call to PHP_Token_Includes::getName()
PHP_Token_Includes::getType in drupal/core/vendor/phpunit/php-token-stream/PHP/Token.php

File

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

Class

PHP_Token_Includes

Code

public function getName() {
  if ($this->name !== NULL) {
    return $this->name;
  }
  $tokens = $this->tokenStream
    ->tokens();
  if ($tokens[$this->id + 2] instanceof PHP_Token_CONSTANT_ENCAPSED_STRING) {
    $this->name = trim($tokens[$this->id + 2], "'\"");
    $this->type = strtolower(str_replace('PHP_Token_', '', get_class($tokens[$this->id])));
  }
  return $this->name;
}