1 <?php declare(strict_types=1);
3 namespace PhpParser\Node;
5 use PhpParser\NodeAbstract;
7 class NullableType extends NodeAbstract
9 /** @var Identifier|Name Type */
13 * Constructs a nullable type (wrapping another type).
15 * @param string|Identifier|Name $type Type
16 * @param array $attributes Additional attributes
18 public function __construct($type, array $attributes = []) {
19 parent::__construct($attributes);
20 $this->type = \is_string($type) ? new Identifier($type) : $type;
23 public function getSubNodeNames() : array {
27 public function getType() : string {
28 return 'NullableType';