Methods |
public
|
__construct(ErrorHandler $errorHandler)
Parameters
$errorHandler |
Error handling used to report errors
|
|
#
|
public
|
startNamespace(Name|null $namespace = null): void
Start a new namespace. This also resets the alias table.
Start a new namespace. This also resets the alias table.
Parameters
$namespace |
Null is the global namespace
|
|
#
|
public
|
addAlias(Name $name, string $aliasName, Use_::TYPE_* $type, array<string, mixed> $errorAttrs = []): void
Parameters
$name |
Original name
|
$aliasName |
Aliased name
|
$type |
One of Stmt\Use_::TYPE_*
|
$errorAttrs |
Attributes to use to report an error
|
|
#
|
public
|
getNamespace(): null|Name
Returns
Namespace (or null if global namespace)
|
#
|
public
|
getResolvedName(Name $name, Use_::TYPE_* $type): null|Name
Parameters
$name |
Name to resolve
|
$type |
One of Stmt\Use_::TYPE_{FUNCTION|CONSTANT}
|
Returns
Resolved name, or null if static resolution is not possible
|
#
|
public
|
getResolvedClassName(Name $name): Name
Parameters
$name |
Class ame to resolve
|
Returns
|
#
|
public
|
getPossibleNames(string $name, Use_::TYPE_* $type): Name[]
Get possible ways of writing a fully qualified name (e.g., by making use of aliases).
Get possible ways of writing a fully qualified name (e.g., by making use of aliases).
Parameters
$name |
Fully-qualified name (without leading namespace separator)
|
$type |
One of Stmt\Use_::TYPE_*
|
Returns
Possible representations of the name
|
#
|
public
|
getShortName(string $name, Use_::TYPE_* $type): Name
Get shortest representation of this fully-qualified name.
Get shortest representation of this fully-qualified name.
Parameters
$name |
Fully-qualified name (without leading namespace separator)
|
$type |
One of Stmt\Use_::TYPE_*
|
Returns
|
#
|