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

Breadcrumb

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

class DoctrineArrayItem

@phpstan-import-type ValueType from DoctrineArgument @phpstan-type KeyType = ConstExprIntegerNode|ConstExprStringNode|IdentifierTypeNode|ConstFetchNode|null

Hierarchy

  • class \PHPStan\PhpDocParser\Ast\PhpDoc\Doctrine\DoctrineArrayItem implements \PHPStan\PhpDocParser\Ast\Node uses \PHPStan\PhpDocParser\Ast\NodeAttributes

Expanded class hierarchy of DoctrineArrayItem

1 file declares its use of DoctrineArrayItem
Printer.php in vendor/phpstan/phpdoc-parser/src/Printer/Printer.php

File

vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/Doctrine/DoctrineArrayItem.php, line 16

Namespace

PHPStan\PhpDocParser\Ast\PhpDoc\Doctrine
View source
class DoctrineArrayItem implements Node {
    use NodeAttributes;
    
    /** @var KeyType */
    public $key;
    
    /** @var ValueType */
    public $value;
    
    /**
     * @param KeyType $key
     * @param ValueType $value
     */
    public function __construct($key, $value) {
        $this->key = $key;
        $this->value = $value;
    }
    public function __toString() : string {
        if ($this->key === null) {
            return (string) $this->value;
        }
        return $this->key . '=' . $this->value;
    }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title
DoctrineArrayItem::$key public property @var KeyType
DoctrineArrayItem::$value public property @var ValueType
DoctrineArrayItem::__construct public function *
DoctrineArrayItem::__toString public function Overrides Node::__toString
NodeAttributes::$attributes private property @var array<string, mixed>
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