You are here

abstract class PHP_Token_Includes in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/phpunit/php-token-stream/src/Token.php \PHP_Token_Includes

Hierarchy

Expanded class hierarchy of PHP_Token_Includes

File

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

View source
abstract class PHP_Token_Includes extends PHP_Token {

  /**
   * @var string
   */
  protected $name;

  /**
   * @var string
   */
  protected $type;

  /**
   * @return string
   */
  public function getName() {
    if ($this->name === null) {
      $this
        ->process();
    }
    return $this->name;
  }

  /**
   * @return string
   */
  public function getType() {
    if ($this->type === null) {
      $this
        ->process();
    }
    return $this->type;
  }
  private function process() {
    $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])));
    }
  }

}

Members

Namesort descending Modifiers Type Description Overrides
PHP_Token::$id protected property
PHP_Token::$line protected property
PHP_Token::$text protected property
PHP_Token::$tokenStream protected property
PHP_Token::getLine public function
PHP_Token::__construct public function Constructor.
PHP_Token::__toString public function
PHP_Token_Includes::$name protected property
PHP_Token_Includes::$type protected property
PHP_Token_Includes::getName public function
PHP_Token_Includes::getType public function
PHP_Token_Includes::process private function