No Description

Interface_.php 1.2KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php declare(strict_types=1);
  2. namespace PhpParser\Node\Stmt;
  3. use PhpParser\Node;
  4. class Interface_ extends ClassLike
  5. {
  6. /** @var Node\Name[] Extended interfaces */
  7. public $extends;
  8. /**
  9. * Constructs a class node.
  10. *
  11. * @param string|Node\Identifier $name Name
  12. * @param array $subNodes Array of the following optional subnodes:
  13. * 'extends' => array(): Name of extended interfaces
  14. * 'stmts' => array(): Statements
  15. * 'attrGroups' => array(): PHP attribute groups
  16. * @param array $attributes Additional attributes
  17. */
  18. public function __construct($name, array $subNodes = [], array $attributes = []) {
  19. $this->attributes = $attributes;
  20. $this->name = \is_string($name) ? new Node\Identifier($name) : $name;
  21. $this->extends = $subNodes['extends'] ?? [];
  22. $this->stmts = $subNodes['stmts'] ?? [];
  23. $this->attrGroups = $subNodes['attrGroups'] ?? [];
  24. }
  25. public function getSubNodeNames() : array {
  26. return ['attrGroups', 'name', 'extends', 'stmts'];
  27. }
  28. public function getType() : string {
  29. return 'Stmt_Interface';
  30. }
  31. }