Overview

Namespaces

  • Pharborist
    • Constants
    • ControlStructures
    • Exceptions
    • Functions
    • Generators
    • Namespaces
    • Objects
    • Operators
    • Types
    • Variables

Classes

  • NameNode
  • NamespaceNode
  • UseDeclarationBlockNode
  • UseDeclarationNode
  • UseDeclarationStatementNode

Traits

  • IdentifierNameTrait
  • Overview
  • Namespace
  • Class

Class UseDeclarationNode

A use declaration importing a class, function, or constant into a namespace.

Example:

use Cleese;
use Chapman as Palin;
Pharborist\Node implements Pharborist\NodeInterface
Extended by Pharborist\ParentNode implements Pharborist\ParentNodeInterface
Extended by Pharborist\Namespaces\UseDeclarationNode
Namespace: Pharborist\Namespaces
Located at Namespaces/UseDeclarationNode.php
Methods summary
public static Pharborist\Namespaces\UseDeclarationNode
# create( string $import )

Parameters

$import
Fully qualified class name; can also include optional alias.

Returns

Pharborist\Namespaces\UseDeclarationNode
public Pharborist\Namespaces\NameNode
# getName( )

Returns

Pharborist\Namespaces\NameNode
public boolean
# hasAlias( )

Returns

boolean
public Pharborist\Node
# getAlias( )

Returns

Pharborist\Node
public
# setAlias( Pharborist\TokenNode|string|null $alias )

Sets the imported item's alias. If NULL is passed, the alias is removed.

Sets the imported item's alias. If NULL is passed, the alias is removed.

Parameters

$alias

Returns


$this
public boolean
# isClass( )

Test if use declaration is for class.

Test if use declaration is for class.

Returns

boolean
TRUE if use declaration of class.
public boolean
# isFunction( )

Test if use declaration is for function.

Test if use declaration is for function.

Returns

boolean
TRUE if use declaration of function.
public boolean
# isConst( )

Test if use declaration is for const.

Test if use declaration is for const.

Returns

boolean
TRUE if use declaration of const.
public string
# getBoundedName( )

Name bounded inside namespace.

Name bounded inside namespace.

Returns

string
Methods inherited from Pharborist\ParentNode
__clone(), __toString(), acceptVisitor(), addChild(), addChildren(), append(), childCount(), children(), clear(), find(), firstChild(), firstToken(), getSourcePosition(), getText(), getTree(), has(), isDescendant(), isEmpty(), lastChild(), lastToken(), mergeNode(), prepend(), walk()
Methods inherited from Pharborist\Node
after(), appendTo(), before(), closest(), fromValue(), furthest(), getLogicalBlock(), getRoot(), getStatement(), hasRoot(), index(), insertAfter(), insertBefore(), is(), isAllOf(), isAnyOf(), next(), nextAll(), nextToken(), nextUntil(), parent(), parents(), parentsUntil(), prependTo(), previous(), previousAll(), previousToken(), previousUntil(), remove(), replaceAll(), replaceWith(), siblings(), sortKey(), swapWith()
Pharborist API documentation generated by ApiGen