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