1 <?php declare(strict_types=1);
3 namespace PhpParser\Node\Stmt;
7 class Interface_ extends ClassLike
9 /** @var Node\Name[] Extended interfaces */
13 * Constructs a class node.
15 * @param string|Node\Identifier $name Name
16 * @param array $subNodes Array of the following optional subnodes:
17 * 'extends' => array(): Name of extended interfaces
18 * 'stmts' => array(): Statements
19 * @param array $attributes Additional attributes
21 public function __construct($name, array $subNodes = [], array $attributes = []) {
22 parent::__construct($attributes);
23 $this->name = \is_string($name) ? new Node\Identifier($name) : $name;
24 $this->extends = $subNodes['extends'] ?? [];
25 $this->stmts = $subNodes['stmts'] ?? [];
28 public function getSubNodeNames() : array {
29 return ['name', 'extends', 'stmts'];
32 public function getType() : string {
33 return 'Stmt_Interface';