AssignOp.php 726 B

1234567891011121314151617181920212223242526272829
  1. <?php declare(strict_types=1);
  2. namespace PhpParser\Node\Expr;
  3. use PhpParser\Node\Expr;
  4. abstract class AssignOp extends Expr {
  5. /** @var Expr Variable */
  6. public Expr $var;
  7. /** @var Expr Expression */
  8. public Expr $expr;
  9. /**
  10. * Constructs a compound assignment operation 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. }