You are here

public function PHP_TokenWithScopeAndVisibility::getKeywords in Zircon Profile 8.0

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

Return value

string

File

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

Class

PHP_TokenWithScopeAndVisibility

Code

public function getKeywords() {
  $keywords = array();
  $tokens = $this->tokenStream
    ->tokens();
  for ($i = $this->id - 2; $i > $this->id - 7; $i -= 2) {
    if (isset($tokens[$i]) && ($tokens[$i] instanceof PHP_Token_PRIVATE || $tokens[$i] instanceof PHP_Token_PROTECTED || $tokens[$i] instanceof PHP_Token_PUBLIC)) {
      continue;
    }
    if (isset($tokens[$i]) && ($tokens[$i] instanceof PHP_Token_STATIC || $tokens[$i] instanceof PHP_Token_FINAL || $tokens[$i] instanceof PHP_Token_ABSTRACT)) {
      $keywords[] = strtolower(str_replace('PHP_Token_', '', get_class($tokens[$i])));
    }
  }
  return implode(',', $keywords);
}