Include_.php 951 B

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