Namespace_.php 939 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php declare(strict_types=1);
  2. namespace PhpParser\Node\Stmt;
  3. use PhpParser\Node;
  4. class Namespace_ extends Node\Stmt
  5. {
  6. /* For use in the "kind" attribute */
  7. const KIND_SEMICOLON = 1;
  8. const KIND_BRACED = 2;
  9. /** @var null|Node\Name Name */
  10. public $name;
  11. /** @var Node\Stmt[] Statements */
  12. public $stmts;
  13. /**
  14. * Constructs a namespace node.
  15. *
  16. * @param null|Node\Name $name Name
  17. * @param null|Node\Stmt[] $stmts Statements
  18. * @param array $attributes Additional attributes
  19. */
  20. public function __construct(Node\Name $name = null, $stmts = [], array $attributes = []) {
  21. $this->attributes = $attributes;
  22. $this->name = $name;
  23. $this->stmts = $stmts;
  24. }
  25. public function getSubNodeNames() : array {
  26. return ['name', 'stmts'];
  27. }
  28. public function getType() : string {
  29. return 'Stmt_Namespace';
  30. }
  31. }