PHP Class PHPSA\AliasManager

Show file Open project: ovr/phpsa Class Usage Examples

Protected Properties

Property Type Description
$aliases a list of imported namespaces
$namespace string | null Current namespace, but this can be null

Public Methods

Method Description
__construct ( string | null $namespace = null )
add ( string $namespace ) Imports a namespace as an alias via use statement.
getNamespace ( ) : null | string Gets the current namespace.
isClassImported ( string $classNS ) : boolean Checks whether a namespace was imported via use statement.
setNamespace ( null | string $namespace ) Sets the current namespace.

Method Details

__construct() public method

public __construct ( string | null $namespace = null )
$namespace string | null

add() public method

Imports a namespace as an alias via use statement.
public add ( string $namespace )
$namespace string

getNamespace() public method

Gets the current namespace.
public getNamespace ( ) : null | string
return null | string

isClassImported() public method

Checks whether a namespace was imported via use statement.
public isClassImported ( string $classNS ) : boolean
$classNS string
return boolean

setNamespace() public method

Sets the current namespace.
public setNamespace ( null | string $namespace )
$namespace null | string

Property Details

$aliases protected property

a list of imported namespaces
protected $aliases

$namespace protected property

Current namespace, but this can be null
protected string|null $namespace
return string | null