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

Breadcrumb

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

function Parser::parseFieldDefinition

Parses a field definition

Return value

Node\PropertyDefinition|null

1 call to Parser::parseFieldDefinition()
Parser::parseClassElement in vendor/mck89/peast/lib/Peast/Syntax/Parser.php
Parses a class elements

File

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

Class

Parser
Parser class

Namespace

Peast\Syntax

Code

protected function parseFieldDefinition() {
    $state = $this->scanner
        ->getState();
    if ($prop = $this->parseClassElementName()) {
        $value = $this->isolateContext(array(
            "allowIn" => true,
        ), "parseInitializer");
        $this->assertEndOfStatement();
        $node = $this->createNode("PropertyDefinition", $prop);
        $node->setKey($prop[0]);
        if ($value) {
            $node->setValue($value);
        }
        $node->setComputed($prop[1]);
        return $this->completeNode($node);
    }
    $this->scanner
        ->setState($state);
    return null;
}

API Navigation

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