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 NameNode

The name of namespace, function, constant, class, trait or interface.

This node is used for things whose name is namespace-aware. Variables, for example, cannot be namespaced, but classes can. That's why class names are wrapped by NameNode: because NameNodes are aware of the namespace they live in, even when moved from one namespace to another.

Pharborist\Node implements Pharborist\NodeInterface
Extended by Pharborist\ParentNode implements Pharborist\ParentNodeInterface
Extended by Pharborist\Namespaces\NameNode
Namespace: Pharborist\Namespaces
Located at Namespaces/NameNode.php
Methods summary
public static Pharborist\Namespaces\NameNode
# create( string $name )

Create namespace path.

Create namespace path.

Parameters

$name

Returns

Pharborist\Namespaces\NameNode
public Pharborist\Namespaces\NamespaceNode
# getNamespace( )

Get the namespace that owns this name.

Get the namespace that owns this name.

Returns

Pharborist\Namespaces\NamespaceNode
The namespace that owns this node.
public string
# getParentPath( )

Returns

string
public array
# getPathInfo( )

Return information about the name.

Return information about the name.

Returns

array
public boolean
# isAbsolute( )

Return TRUE if the name is an absolute name. Eg. \TopNamespace\SubNamespace\MyClass

Return TRUE if the name is an absolute name. Eg. \TopNamespace\SubNamespace\MyClass

Returns

boolean
public boolean
# isRelative( )

Return TRUE if the name is a relative name. Eg. namespace\MyClass

Return TRUE if the name is a relative name. Eg. namespace\MyClass

Returns

boolean
public boolean
# isUnqualified( )

Return TRUE if the name is a qualified name. Eg. MyNamespace\MyClass

Return TRUE if the name is a qualified name. Eg. MyNamespace\MyClass

Returns

boolean
public boolean
# isQualified( )

Return TRUE if the name is a qualified name. Eg. MyNamespace\MyClass

Return TRUE if the name is a qualified name. Eg. MyNamespace\MyClass

Returns

boolean
public Pharborist\TokenNode[]
# getParts( )

Returns

Pharborist\TokenNode[]
public string
# getPath( )

Get the namespace path.

Get the namespace path.

Returns

string
public string
# getAbsolutePath( )

Returns

string
The absolute namespace path.
public boolean
# isGlobal( )

Returns if this name is in the global namespace, which is functionally the same as having no namespace.

Returns if this name is in the global namespace, which is functionally the same as having no namespace.

Returns

boolean
public string
# getBaseName( )

Returns trailing name component of path.

Returns trailing name component of path.

Returns

string
Last component of path.
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