1<?php declare(strict_types=1);
2
3namespace PhpParser\Node\Expr;
4
5use PhpParser\Node\Expr;
6
7class Include_ extends Expr {
8    public const TYPE_INCLUDE      = 1;
9    public const TYPE_INCLUDE_ONCE = 2;
10    public const TYPE_REQUIRE      = 3;
11    public const TYPE_REQUIRE_ONCE = 4;
12
13    /** @var Expr Expression */
14    public Expr $expr;
15    /** @var int Type of include */
16    public int $type;
17
18    /**
19     * Constructs an include node.
20     *
21     * @param Expr $expr Expression
22     * @param int $type Type of include
23     * @param array<string, mixed> $attributes Additional attributes
24     */
25    public function __construct(Expr $expr, int $type, array $attributes = []) {
26        $this->attributes = $attributes;
27        $this->expr = $expr;
28        $this->type = $type;
29    }
30
31    public function getSubNodeNames(): array {
32        return ['expr', 'type'];
33    }
34
35    public function getType(): string {
36        return 'Expr_Include';
37    }
38}
39