public function PHP_Token_INTERFACE::getInterfaces

File

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

Class

PHP_Token_INTERFACE

Code

public function getInterfaces() {
  if ($this->interfaces !== NULL) {
    return $this->interfaces;
  }
  if (!$this
    ->hasInterfaces()) {
    return $this->interfaces = FALSE;
  }
  if ($this->tokenStream[$this->id + 4] instanceof PHP_Token_IMPLEMENTS) {
    $i = $this->id + 3;
  }
  else {
    $i = $this->id + 7;
  }
  $tokens = $this->tokenStream
    ->tokens();
  while (!$tokens[$i + 1] instanceof PHP_Token_OPEN_CURLY) {
    $i++;
    if ($tokens[$i] instanceof PHP_Token_STRING) {
      $this->interfaces[] = (string) $tokens[$i];
    }
  }
  return $this->interfaces;
}