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

Breadcrumb

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

class AssignmentProperty

A node that represents a property in an object binding pattern. For example "a" in: var {a} = b

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

Hierarchy

  • class \Peast\Syntax\Node\Node implements \Peast\Syntax\Node\JSONSerializable
    • class \Peast\Syntax\Node\Property extends \Peast\Syntax\Node\Node
      • class \Peast\Syntax\Node\AssignmentProperty extends \Peast\Syntax\Node\Property

Expanded class hierarchy of AssignmentProperty

3 string references to 'AssignmentProperty'
ObjectPattern::setProperties in vendor/mck89/peast/lib/Peast/Syntax/Node/ObjectPattern.php
Sets object properties
Parser::expressionToPattern in vendor/mck89/peast/lib/Peast/Syntax/Parser.php
Converts an expression node to a pattern node
Parser::parseBindingProperty in vendor/mck89/peast/lib/Peast/Syntax/Parser.php
Parses a property in an object binding pattern

File

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

Namespace

Peast\Syntax\Node
View source
class AssignmentProperty extends Property {
    
    /**
     * Returns node's type
     * 
     * @return string
     */
    public function getType() {
        return "Property";
    }
    
    /**
     * Sets the property value
     * 
     * @param Pattern $value Property value
     * 
     * @return $this
     */
    public function setValue($value) {
        $this->assertType($value, "Pattern");
        $this->value = $value;
        return $this;
    }
    
    /**
     * Sets the property kind that is one of the kind constants
     * 
     * @param string $kind Property kind
     * 
     * @return $this
     * 
     * @codeCoverageIgnore
     */
    public function setKind($kind) {
        return $this;
    }
    
    /**
     * Sets the property method flag that is true when the property is a method
     * 
     * @param bool $method Method flag
     * 
     * @return $this
     * 
     * @codeCoverageIgnore
     */
    public function setMethod($method) {
        return $this;
    }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title Overrides
AssignmentProperty::getType public function Returns node&#039;s type Overrides Node::getType
AssignmentProperty::setKind public function Sets the property kind that is one of the kind constants Overrides Property::setKind
AssignmentProperty::setMethod public function Sets the property method flag that is true when the property is a method Overrides Property::setMethod
AssignmentProperty::setValue public function Sets the property value Overrides Property::setValue
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::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
Property::$computed protected property Property computed flag that is true when the property is declared using
the square brackets syntax
Property::$key protected property Property key
Property::$kind protected property Property kind that is one of the kind constants
Property::$method protected property Property method flag that is true when the property is a method
Property::$propertiesMap protected property Map of node properties Overrides Node::$propertiesMap
Property::$shorthand protected property Property shorthand flag that is true when the property is declared
using an identifier and without a value
Property::$value protected property Property value
Property::getComputed public function Returns the property computed flag that is true when the property is
declared using the square brackets syntax
Property::getKey public function Returns the property key
Property::getKind public function Returns the property kind that is one of the kind constants
Property::getMethod public function Returns the property method flag that is true when the property is a
method
Property::getShorthand public function Returns the property shorthand flag that is true when the property
is declared using an identifier and without a value
Property::getValue public function Returns the property value
Property::KIND_GET constant Getter property
Property::KIND_INIT constant The default kind for properties
Property::KIND_SET constant Setter property
Property::setComputed public function Sets the property computed flag that is true when the property is
declared using the square brackets syntax
Property::setKey public function Sets the property key
Property::setShorthand public function Sets the property shorthand flag that is true when the property
is declared using an identifier and without a value

API Navigation

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