AssignRef.php 823 B

123456789101112131415161718192021222324252627282930313233
  1. <?php declare(strict_types=1);
  2. namespace PhpParser\Node\Expr;
  3. use PhpParser\Node\Expr;
  4. class AssignRef extends Expr {
  5. /** @var Expr Variable reference is assigned to */
  6. public Expr $var;
  7. /** @var Expr Variable which is referenced */
  8. public Expr $expr;
  9. /**
  10. * Constructs an assignment node.
  11. *
  12. * @param Expr $var Variable
  13. * @param Expr $expr Expression
  14. * @param array<string, mixed> $attributes Additional attributes
  15. */
  16. public function __construct(Expr $var, Expr $expr, array $attributes = []) {
  17. $this->attributes = $attributes;
  18. $this->var = $var;
  19. $this->expr = $expr;
  20. }
  21. public function getSubNodeNames(): array {
  22. return ['var', 'expr'];
  23. }
  24. public function getType(): string {
  25. return 'Expr_AssignRef';
  26. }
  27. }