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

Breadcrumb

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

trait NodeAttributes

Hierarchy

  • trait \PHPStan\PhpDocParser\Ast\NodeAttributes
67 files declare their use of NodeAttributes
ArrayShapeItemNode.php in vendor/phpstan/phpdoc-parser/src/Ast/Type/ArrayShapeItemNode.php
ArrayShapeNode.php in vendor/phpstan/phpdoc-parser/src/Ast/Type/ArrayShapeNode.php
ArrayShapeUnsealedTypeNode.php in vendor/phpstan/phpdoc-parser/src/Ast/Type/ArrayShapeUnsealedTypeNode.php
ArrayTypeNode.php in vendor/phpstan/phpdoc-parser/src/Ast/Type/ArrayTypeNode.php
AssertTagMethodValueNode.php in vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/AssertTagMethodValueNode.php

... See full list

File

vendor/phpstan/phpdoc-parser/src/Ast/NodeAttributes.php, line 7

Namespace

PHPStan\PhpDocParser\Ast
View source
trait NodeAttributes {
    
    /** @var array<string, mixed> */
    private $attributes = [];
    
    /**
     * @param mixed $value
     */
    public function setAttribute(string $key, $value) : void {
        $this->attributes[$key] = $value;
    }
    public function hasAttribute(string $key) : bool {
        return array_key_exists($key, $this->attributes);
    }
    
    /**
     * @return mixed
     */
    public function getAttribute(string $key) {
        if ($this->hasAttribute($key)) {
            return $this->attributes[$key];
        }
        return null;
    }

}

Members

Title Sort descending Modifiers Object type Summary
NodeAttributes::$attributes private property @var array&lt;string, mixed&gt;
NodeAttributes::getAttribute public function *
NodeAttributes::hasAttribute public function
NodeAttributes::setAttribute public function *

API Navigation

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