function Parser::parseArrowParameters
Parses parameters in an arrow function. If the parameters are wrapped in round brackets, the returned value is an array where the first element is the parameters list and the second element is the open round brackets, this is needed to know the start position
Return value
Node\Identifier|array|null
1 call to Parser::parseArrowParameters()
- Parser::parseArrowFunction in vendor/
mck89/ peast/ lib/ Peast/ Syntax/ Parser.php - Parses an arrow function
File
-
vendor/
mck89/ peast/ lib/ Peast/ Syntax/ Parser.php, line 2718
Class
- Parser
- Parser class
Namespace
Peast\SyntaxCode
protected function parseArrowParameters() {
if ($param = $this->parseIdentifier(static::$bindingIdentifier, "=>")) {
return $param;
}
elseif ($token = $this->scanner
->consume("(")) {
$params = $this->parseFormalParameterList();
if ($params !== null && $this->scanner
->consume(")")) {
return array(
$params,
$token,
);
}
}
return null;
}