Просмотр файла vendor/nikic/php-parser/lib/PhpParser/Node/NullableType.php

Размер файла: 743B
  1. <?php declare(strict_types=1);
  2.  
  3. namespace PhpParser\Node;
  4.  
  5. use PhpParser\NodeAbstract;
  6.  
  7. class NullableType extends NodeAbstract
  8. {
  9. /** @var Identifier|Name Type */
  10. public $type;
  11.  
  12. /**
  13. * Constructs a nullable type (wrapping another type).
  14. *
  15. * @param string|Identifier|Name $type Type
  16. * @param array $attributes Additional attributes
  17. */
  18. public function __construct($type, array $attributes = []) {
  19. $this->attributes = $attributes;
  20. $this->type = \is_string($type) ? new Identifier($type) : $type;
  21. }
  22.  
  23. public function getSubNodeNames() : array {
  24. return ['type'];
  25. }
  26. public function getType() : string {
  27. return 'NullableType';
  28. }
  29. }