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

Breadcrumb

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

function BuilderHelpers::normalizeNode

Normalizes a node: Converts builder objects to nodes.

Parameters

Node|Builder $node The node to normalize:

Return value

Node The normalized node

7 calls to BuilderHelpers::normalizeNode()
BuilderHelpers::normalizeStmt in vendor/nikic/php-parser/lib/PhpParser/BuilderHelpers.php
Normalizes a node to a statement.
Class_::addStmt in vendor/nikic/php-parser/lib/PhpParser/Builder/Class_.php
Adds a statement.
Enum_::addStmt in vendor/nikic/php-parser/lib/PhpParser/Builder/Enum_.php
Adds a statement.
FunctionLike::addParam in vendor/nikic/php-parser/lib/PhpParser/Builder/FunctionLike.php
Adds a parameter.
Interface_::addStmt in vendor/nikic/php-parser/lib/PhpParser/Builder/Interface_.php
Adds a statement.

... See full list

File

vendor/nikic/php-parser/lib/PhpParser/BuilderHelpers.php, line 27

Class

BuilderHelpers
This class defines helpers used in the implementation of builders. Don't use it directly.

Namespace

PhpParser

Code

public static function normalizeNode($node) : Node {
    if ($node instanceof Builder) {
        return $node->getNode();
    }
    if ($node instanceof Node) {
        return $node;
    }
    throw new \LogicException('Expected node or builder object');
}

API Navigation

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