Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. MemberExpression.php

class MemberExpression

A node that represents a member expression. For example: foo.bar

@author Marco Marchiò <marco.mm89@gmail.com>

Hierarchy

  • class \Peast\Syntax\Node\Node implements \Peast\Syntax\Node\JSONSerializable
    • class \Peast\Syntax\Node\ChainElement extends \Peast\Syntax\Node\Node implements \Peast\Syntax\Node\Expression
      • class \Peast\Syntax\Node\MemberExpression extends \Peast\Syntax\Node\ChainElement implements \Peast\Syntax\Node\Pattern

Expanded class hierarchy of MemberExpression

3 string references to 'MemberExpression'
Parser::parseLeftHandSideExpression in vendor/mck89/peast/lib/Peast/Syntax/Parser.php
Parses a left hand side expression
Parser::parseSuperPropertyOrCall in vendor/mck89/peast/lib/Peast/Syntax/Parser.php
Parses a super call or a super property
Renderer::renderNode in vendor/mck89/peast/lib/Peast/Renderer.php
Renders a node

File

vendor/mck89/peast/lib/Peast/Syntax/Node/MemberExpression.php, line 18

Namespace

Peast\Syntax\Node
View source
class MemberExpression extends ChainElement implements Pattern {
    
    /**
     * Map of node properties
     * 
     * @var array 
     */
    protected $propertiesMap = array(
        "object" => true,
        "property" => true,
        "computed" => false,
    );
    
    /**
     * Expression's object
     * 
     * @var Expression|Super 
     */
    protected $object;
    
    /**
     * Expression's property
     * 
     * @var Expression|PrivateIdentifier
     */
    protected $property;
    
    /**
     * Computed flag that is true if the property is declared using square
     * brackets syntax
     * 
     * @var bool 
     */
    protected $computed = false;
    
    /**
     * Returns the expression's object
     * 
     * @return Expression|Super 
     */
    public function getObject() {
        return $this->object;
    }
    
    /**
     * Sets the expression's object
     * 
     * @param Expression|Super $object Object
     * 
     * @return $this
     */
    public function setObject($object) {
        $this->assertType($object, array(
            "Expression",
            "Super",
        ));
        $this->object = $object;
        return $this;
    }
    
    /**
     * Returns the expression's property
     * 
     * @return Expression|PrivateIdentifier
     */
    public function getProperty() {
        return $this->property;
    }
    
    /**
     * Sets the expression's property
     * 
     * @param Expression|PrivateIdentifier $property Property
     * 
     * @return $this
     */
    public function setProperty($property) {
        $this->assertType($property, array(
            "Expression",
            "PrivateIdentifier",
        ));
        $this->property = $property;
        return $this;
    }
    
    /**
     * Returns the computed flag that is true if the property is declared
     * using square brackets syntax
     * 
     * @return bool
     */
    public function getComputed() {
        return $this->computed;
    }
    
    /**
     * Sets the computed flag that is true if the property is declared
     * using square brackets syntax
     * 
     * @param bool $computed Computed flag
     * 
     * @return $this
     */
    public function setComputed($computed) {
        $this->computed = (bool) $computed;
        return $this;
    }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title Overrides
ChainElement::$optional protected property Optional flag that is true if the node is in the optional
part of a chain expression
ChainElement::getOptional public function Returns the optional flag that is true if the node is in
the optional part of a chain expression
ChainElement::setOptional public function Sets the optional flag that is true if the node is in
the optional part of a chain expression
MemberExpression::$computed protected property Computed flag that is true if the property is declared using square
brackets syntax
MemberExpression::$object protected property Expression&#039;s object
MemberExpression::$propertiesMap protected property Map of node properties Overrides ChainElement::$propertiesMap
MemberExpression::$property protected property Expression&#039;s property
MemberExpression::getComputed public function Returns the computed flag that is true if the property is declared
using square brackets syntax
MemberExpression::getObject public function Returns the expression&#039;s object
MemberExpression::getProperty public function Returns the expression&#039;s property
MemberExpression::setComputed public function Sets the computed flag that is true if the property is declared
using square brackets syntax
MemberExpression::setObject public function Sets the expression&#039;s object
MemberExpression::setProperty public function Sets the expression&#039;s property
Node::$leadingComments protected property Leading comments array
Node::$location public property Node location in the source code
Node::$trailingComments protected property Trailing comments array
Node::assertArrayOf protected function Asserts that the given value is an array of defined type
Node::assertType protected function Asserts that the given value respects the defined type
Node::getLeadingComments public function Returns leading comments array
Node::getLocation public function Returns node location in the source code
Node::getTrailingComments public function Returns trailing comments array
Node::getType public function Returns node type 2
Node::jsonSerialize public function Returns a serializable version of the node 2
Node::render public function Renders the current node
Node::setEndPosition public function Sets the end position of the node in the source code
Node::setLeadingComments public function Sets leading comments array 1
Node::setStartPosition public function Sets the start position of the node in the source code
Node::setTrailingComments public function Sets trailing comments array 1
Node::traverse public function Traverses the current node and all its child nodes using the given
function
Node::typeError protected function Throws an error if the defined type is not supported b
Node::__construct public function Class constructor

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal