Label.php 718 B

12345678910111213141516171819202122232425262728293031
  1. <?php declare(strict_types=1);
  2. namespace PhpParser\Node\Stmt;
  3. use PhpParser\Node\Identifier;
  4. use PhpParser\Node\Stmt;
  5. class Label extends Stmt
  6. {
  7. /** @var Identifier Name */
  8. public $name;
  9. /**
  10. * Constructs a label node.
  11. *
  12. * @param string|Identifier $name Name
  13. * @param array $attributes Additional attributes
  14. */
  15. public function __construct($name, array $attributes = []) {
  16. parent::__construct($attributes);
  17. $this->name = \is_string($name) ? new Identifier($name) : $name;
  18. }
  19. public function getSubNodeNames() : array {
  20. return ['name'];
  21. }
  22. public function getType() : string {
  23. return 'Stmt_Label';
  24. }
  25. }