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

Breadcrumb

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

function BuilderFactory::var

Creates variable node.

Parameters

string|Expr $name Name:

File

vendor/nikic/php-parser/lib/PhpParser/BuilderFactory.php, line 224

Class

BuilderFactory

Namespace

PhpParser

Code

public function var($name) : Expr\Variable {
    if (!\is_string($name) && !$name instanceof Expr) {
        throw new \LogicException('Variable name must be string or Expr');
    }
    return new Expr\Variable($name);
}

API Navigation

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