public function PHP_Token_FUNCTION::getArguments

File

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

Class

PHP_Token_FUNCTION

Code

public function getArguments() {
  if ($this->arguments !== NULL) {
    return $this->arguments;
  }
  $this->arguments = array();
  $i = $this->id + 3;
  $tokens = $this->tokenStream
    ->tokens();
  $typeHint = NULL;
  while (!$tokens[$i] instanceof PHP_Token_CLOSE_BRACKET) {
    if ($tokens[$i] instanceof PHP_Token_STRING) {
      $typeHint = (string) $tokens[$i];
    }
    else {
      if ($tokens[$i] instanceof PHP_Token_VARIABLE) {
        $this->arguments[(string) $tokens[$i]] = $typeHint;
        $typeHint = NULL;
      }
    }
    $i++;
  }
  return $this->arguments;
}