CloneableInstantiable
Methods
public __construct(PhpParser\ErrorHandler $errorHandler)
 

Create a name context.

    public addAlias(PhpParser\Node\Name $name, string $aliasName, int $type, array $errorAttrs = [])
     

    Add an alias / import.

      public getNamespace()
       

      Get current namespace.

      • return null|Name Namespace (or null if global namespace)
      public getPossibleNames(string $name, int $type) : array
       

      Get possible ways of writing a fully qualified name (e.g., by making use of aliases).

      • return Name[] Possible representations of the name
      public getResolvedClassName(PhpParser\Node\Name $name) : PhpParser\Node\Name
       

      Get resolved class name.

      • return Name Resolved name
      public getResolvedName(PhpParser\Node\Name $name, int $type)
       

      Get resolved name.

      • return null|Name Resolved name, or null if static resolution is not possible
      public getShortName(string $name, int $type) : PhpParser\Node\Name
       

      Get shortest representation of this fully-qualified name.

      • return Name Shortest representation
      public startNamespace(?PhpParser\Node\Name $namespace = NULL)
       

      Start a new namespace.

      This also resets the alias table.

        Properties
        protected $aliases
         
        • var Name[] Map of format [aliasType => [aliasName => originalName]]
        protected $errorHandler
         
        protected $namespace
         
        • var null|Name Current namespace
        protected $origAliases
         
        • var Name[] Same as $aliases but preserving original case
        Methods
        private getNamespaceRelativeName(string $name, string $lcName, int $type)
        private normalizeConstName(string $name)
        private resolveAlias(PhpParser\Node\Name $name, $type)
        © 2020 Bruce Wells
        Search Namespaces \ Classes
        ConfigurationNumbers (0-9.) only