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\ConstExprView 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 | * |