You are here

public function PHP_Token_FUNCTION::getSignature in Zircon Profile 8.0

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

Return value

string

File

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

Class

PHP_Token_FUNCTION

Code

public function getSignature() {
  if ($this->signature !== null) {
    return $this->signature;
  }
  if ($this
    ->getName() == 'anonymous function') {
    $this->signature = 'anonymous function';
    $i = $this->id + 1;
  }
  else {
    $this->signature = '';
    $i = $this->id + 2;
  }
  $tokens = $this->tokenStream
    ->tokens();
  while (isset($tokens[$i]) && !$tokens[$i] instanceof PHP_Token_OPEN_CURLY && !$tokens[$i] instanceof PHP_Token_SEMICOLON) {
    $this->signature .= $tokens[$i++];
  }
  $this->signature = trim($this->signature);
  return $this->signature;
}