Instanceof_.php 836 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php declare(strict_types=1);
  2. namespace PhpParser\Node\Expr;
  3. use PhpParser\Node\Expr;
  4. use PhpParser\Node\Name;
  5. class Instanceof_ extends Expr
  6. {
  7. /** @var Expr Expression */
  8. public $expr;
  9. /** @var Name|Expr Class name */
  10. public $class;
  11. /**
  12. * Constructs an instanceof check node.
  13. *
  14. * @param Expr $expr Expression
  15. * @param Name|Expr $class Class name
  16. * @param array $attributes Additional attributes
  17. */
  18. public function __construct(Expr $expr, $class, array $attributes = []) {
  19. $this->attributes = $attributes;
  20. $this->expr = $expr;
  21. $this->class = $class;
  22. }
  23. public function getSubNodeNames() : array {
  24. return ['expr', 'class'];
  25. }
  26. public function getType() : string {
  27. return 'Expr_Instanceof';
  28. }
  29. }