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