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

Breadcrumb

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

class Identifier

Same name in this branch
  1. 11.1.x vendor/nikic/php-parser/lib/PhpParser/Node/Identifier.php \PhpParser\Node\Identifier

A node that represents an identifier.

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

Hierarchy

  • class \Peast\Syntax\Node\Node implements \Peast\Syntax\Node\JSONSerializable
    • class \Peast\Syntax\Node\Identifier extends \Peast\Syntax\Node\Node implements \Peast\Syntax\Node\Expression, \Peast\Syntax\Node\Pattern

Expanded class hierarchy of Identifier

1 file declares its use of Identifier
JSXIdentifier.php in vendor/mck89/peast/lib/Peast/Syntax/Node/JSX/JSXIdentifier.php
19 string references to 'Identifier'
BreakStatement::setLabel in vendor/mck89/peast/lib/Peast/Syntax/Node/BreakStatement.php
Sets the node's label
ClassDeclaration::setId in vendor/mck89/peast/lib/Peast/Syntax/Node/ClassDeclaration.php
Sets the class identifier
Class_::setId in vendor/mck89/peast/lib/Peast/Syntax/Node/Class_.php
Sets class name
ContinueStatement::setLabel in vendor/mck89/peast/lib/Peast/Syntax/Node/ContinueStatement.php
Sets the node's label
DatabaseBackend::schemaDefinition in core/lib/Drupal/Core/Flood/DatabaseBackend.php
Defines the schema for the flood table.

... See full list

File

vendor/mck89/peast/lib/Peast/Syntax/Node/Identifier.php, line 19

Namespace

Peast\Syntax\Node
View source
class Identifier extends Node implements Expression, Pattern {
    
    /**
     * Map of node properties
     * 
     * @var array 
     */
    protected $propertiesMap = array(
        "name" => false,
        "rawName" => false,
    );
    
    /**
     * The identifier's name
     * 
     * @var string
     */
    protected $name;
    
    /**
     * The identifier's raw name
     * 
     * @var string
     */
    protected $rawName;
    
    /**
     * Returns the identifier's name
     * 
     * @return string
     */
    public function getName() {
        return $this->name;
    }
    
    /**
     * Sets the identifier's name
     * 
     * @param string $name The name to set
     * 
     * @return $this
     */
    public function setName($name) {
        $this->name = $this->rawName = $name;
        return $this;
    }
    
    /**
     * Returns the identifier's raw name
     * 
     * @return string
     */
    public function getRawName() {
        return $this->rawName;
    }
    
    /**
     * Sets the identifier's raw name
     * 
     * @param string $name The raw name to set
     * 
     * @return $this
     */
    public function setRawName($name) {
        $this->rawName = $name;
        if (strpos($name, "\\") !== false) {
            $this->name = preg_replace_callback("#\\\\u(?:\\{([a-fA-F0-9]+)\\}|([a-fA-F0-9]{4}))#", function ($match) {
                return Utils::unicodeToUtf8(hexdec($match[1] ?: $match[2]));
            }, $name);
        }
        else {
            $this->name = $name;
        }
        return $this;
    }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title Overrides
Identifier::$name protected property The identifier&#039;s name
Identifier::$propertiesMap protected property Map of node properties Overrides Node::$propertiesMap
Identifier::$rawName protected property The identifier&#039;s raw name
Identifier::getName public function Returns the identifier&#039;s name
Identifier::getRawName public function Returns the identifier&#039;s raw name
Identifier::setName public function Sets the identifier&#039;s name
Identifier::setRawName public function Sets the identifier&#039;s raw name
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
RSS feed
Powered by Drupal