Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Parser.php

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\Syntax

Code

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

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal