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

Breadcrumb

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

class ConstExprArrayItemNode

Hierarchy

  • class \PHPStan\PhpDocParser\Ast\ConstExpr\ConstExprArrayItemNode implements \PHPStan\PhpDocParser\Ast\ConstExpr\ConstExprNode uses \PHPStan\PhpDocParser\Ast\NodeAttributes

Expanded class hierarchy of ConstExprArrayItemNode

File

vendor/phpstan/phpdoc-parser/src/Ast/ConstExpr/ConstExprArrayItemNode.php, line 8

Namespace

PHPStan\PhpDocParser\Ast\ConstExpr
View source
class ConstExprArrayItemNode implements ConstExprNode {
    use NodeAttributes;
    
    /** @var ConstExprNode|null */
    public $key;
    
    /** @var ConstExprNode */
    public $value;
    public function __construct(?ConstExprNode $key, ConstExprNode $value) {
        $this->key = $key;
        $this->value = $value;
    }
    public function __toString() : string {
        if ($this->key !== null) {
            return sprintf('%s => %s', $this->key, $this->value);
        }
        return (string) $this->value;
    }

}

Members

Title Sort descending Modifiers Object type Summary
ConstExprArrayItemNode::$key public property @var ConstExprNode|null
ConstExprArrayItemNode::$value public property @var ConstExprNode
ConstExprArrayItemNode::__construct public function
ConstExprArrayItemNode::__toString public function
NodeAttributes::$attributes private property @var array<string, mixed>
NodeAttributes::getAttribute public function *
NodeAttributes::hasAttribute public function
NodeAttributes::setAttribute public function *
RSS feed
Powered by Drupal