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
Namespace
PhpParser\NodeVisitorCode
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;
}