Block.php 646 B

1234567891011121314151617181920212223242526272829
  1. <?php declare(strict_types=1);
  2. namespace PhpParser\Node\Stmt;
  3. use PhpParser\Node\Stmt;
  4. class Block extends Stmt {
  5. /** @var Stmt[] Statements */
  6. public array $stmts;
  7. /**
  8. * A block of statements.
  9. *
  10. * @param Stmt[] $stmts Statements
  11. * @param array<string, mixed> $attributes Additional attributes
  12. */
  13. public function __construct(array $stmts, array $attributes = []) {
  14. $this->attributes = $attributes;
  15. $this->stmts = $stmts;
  16. }
  17. public function getType(): string {
  18. return 'Stmt_Block';
  19. }
  20. public function getSubNodeNames(): array {
  21. return ['stmts'];
  22. }
  23. }