Include_.php 920 B

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