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

Breadcrumb

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

function NameResolver::__construct

Constructs a name resolution visitor.

Options:

  • preserveOriginalNames (default false): An "originalName" attribute will be added to all name nodes that underwent resolution.
  • replaceNodes (default true): Resolved names are replaced in-place. Otherwise, a resolvedName attribute is added. (Names that cannot be statically resolved receive a namespacedName attribute, as usual.)

Parameters

ErrorHandler|null $errorHandler Error handler:

array{preserveOriginalNames?: bool, replaceNodes?: bool} $options Options:

File

vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/NameResolver.php, line 37

Class

NameResolver

Namespace

PhpParser\NodeVisitor

Code

public function __construct(?ErrorHandler $errorHandler = null, array $options = []) {
    $this->nameContext = new NameContext($errorHandler ?? new ErrorHandler\Throwing());
    $this->preserveOriginalNames = $options['preserveOriginalNames'] ?? false;
    $this->replaceNodes = $options['replaceNodes'] ?? true;
}

API Navigation

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