No Description

Namespace_.php 939B

123456789101112131415161718192021222324252627282930313233343536373839
  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. }