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

Breadcrumb

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

function Parser::parseClassTail

Parses the code that comes after the class keyword and class name. The return value is an array where the first item is the extended class, if any, and the second value is the class body

Return value

array|null

2 calls to Parser::parseClassTail()
Parser::parseClassDeclaration in vendor/mck89/peast/lib/Peast/Syntax/Parser.php
Parses a class declaration
Parser::parseClassExpression in vendor/mck89/peast/lib/Peast/Syntax/Parser.php
Parses a class expression

File

vendor/mck89/peast/lib/Peast/Syntax/Parser.php, line 1718

Class

Parser
Parser class

Namespace

Peast\Syntax

Code

protected function parseClassTail() {
    $heritage = $this->parseClassHeritage();
    if ($token = $this->scanner
        ->consume("{")) {
        $body = $this->parseClassBody();
        if ($this->scanner
            ->consume("}")) {
            $body->location->start = $token->location->start;
            $body->location->end = $this->scanner
                ->getPosition();
            return array(
                $heritage,
                $body,
            );
        }
    }
    $this->error();
}

API Navigation

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