Copied!
CloneableInstantiable
Methods
public __construct(?PhpParser\ErrorHandler $errorHandler = NULL, array $options = [])
 

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.)
  • param \ErrorHandler|null $errorHandler Error handler
  • param array $options Options
public PhpParser\NodeVisitorAbstract::afterTraverse(array $nodes)
public beforeTraverse(array $nodes)
public enterNode(PhpParser\Node $node)
public getNameContext() : PhpParser\NameContext
 

Get name resolution context.

  • return \NameContext
public PhpParser\NodeVisitorAbstract::leaveNode(PhpParser\Node $node)
Properties
protected $nameContext = NULL
 
  • var \NameContext Naming context
protected $preserveOriginalNames = NULL
 
  • var bool Whether to preserve original names
protected $replaceNodes = NULL
 
  • var bool Whether to replace resolved nodes in place, or to add resolvedNode attributes
Methods
protected addNamespacedName(PhpParser\Node $node)
protected resolveAttrGroups(PhpParser\Node $node)
protected resolveClassName(PhpParser\Node\Name $name)
protected resolveName(PhpParser\Node\Name $name, int $type) : PhpParser\Node\Name
 

Resolve name, according to name resolver options.

  • param \Name $name Function or constant name to resolve
  • param int $type One of Stmt\Use::TYPE*
  • return \Name Resolved name, or original name with attribute
Methods
private addAlias(PhpParser\Node\Stmt\UseUse $use, int $type, ?PhpParser\Node\Name $prefix = NULL)
private resolveSignature( $node)
 
  • param \Stmt\Function_|\Stmt\ClassMethod|\Expr\Closure $node
private resolveType( $node)
© 2023 Bruce Wells
Search Namespaces \ Classes
Configuration