Overview

Namespaces

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

Classes

  • ClassConstantLookupNode
  • ClassMemberListNode
  • ClassMemberLookupNode
  • ClassMemberNode
  • ClassMethodCallNode
  • ClassMethodNode
  • ClassNameScalarNode
  • ClassNode
  • ClassStatementNode
  • InterfaceMethodNode
  • InterfaceNode
  • NameExpressionNode
  • NewNode
  • ObjectMethodCallNode
  • ObjectPropertyNode
  • SingleInheritanceNode
  • TraitAdaptationStatementNode
  • TraitAliasNode
  • TraitMethodReferenceNode
  • TraitNode
  • TraitPrecedenceNode
  • TraitUseNode

Interfaces

  • InterfaceStatementNode

Traits

  • MethodTrait
  • VisibilityTrait
  • Overview
  • Namespace
  • Class

Class ClassMemberNode

A single class member in a ClassMemberListNode.

The relationship between class members and class member lists can be a bit confusing. Both of these are considered class member lists:

protected $foo;  // A member list with one member.
private $bar, $baz;

The individual members in those lists are $foo, $bar, and $baz. Each of them is a ClassMemberNode, which will render as $foo, $bar, and $baz, respectively. And each is a child of a parent ClassMemberListNode, which has a visibility and static-ness.

ClassMemberNode's getVisibility(), setVisibility(), and is/get/setStatic() methods are actually convenience methods which call the same method on the parent member list. But the visibility and static keywords are still attributes of the list, not the individual member.

Pharborist\Node implements Pharborist\NodeInterface
Extended by Pharborist\ParentNode implements Pharborist\ParentNodeInterface
Extended by Pharborist\Objects\ClassMemberNode
Namespace: Pharborist\Objects
See: Pharborist\Objects\ClassMemberListNode
Located at Objects/ClassMemberNode.php
Methods summary
public static Pharborist\Objects\ClassMemberListNode
# create( string $name, Pharborist\ExpressionNode $value = NULL, string $visibility = 'public' )

Creates a new class member.

Creates a new class member.

Parameters

$name
The name of the member, with or without the leading $.
$value
The default value of the member, if any.
$visibility

The member's visibility. Can be public, private, or protected. Defaults to public.

Returns

Pharborist\Objects\ClassMemberListNode
public Pharborist\Node
# getName( )

Returns

Pharborist\Node
public Pharborist\Node
# getValue( )

Returns

Pharborist\Node
public boolean
# isStatic( )

Returns

boolean

See

\Pharborist\ClassMemberListNode::isStatic()
public Pharborist\TokenNode
# getStatic( )

Returns

Pharborist\TokenNode

See

\Pharborist\ClassMemberListNode::getStatic()
public
# setStatic( boolean $is_static )

Parameters

$is_static

Returns


$this

See

\Pharborist\ClassMemberListNode::setStatic()
public Pharborist\TokenNode
# getVisibility( )

Returns

Pharborist\TokenNode

See

\Pharborist\VisibilityTrait::getVisibility()
public
# setVisibility( string|integer|Pharborist\TokenNode|null $visibility )

Parameters

$visibility

Returns


$this

See

\Pharborist\VisibilityTrait::setVisibility()
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