You are here

public function PHP_Token_INTERFACE::getInterfaces in Zircon Profile 8.0

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

Return value

array|boolean

File

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

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