DiffElem.php 763 B

12345678910111213141516171819202122232425262728293031
  1. <?php declare(strict_types=1);
  2. namespace PhpParser\Internal;
  3. /**
  4. * @internal
  5. */
  6. class DiffElem {
  7. public const TYPE_KEEP = 0;
  8. public const TYPE_REMOVE = 1;
  9. public const TYPE_ADD = 2;
  10. public const TYPE_REPLACE = 3;
  11. /** @var int One of the TYPE_* constants */
  12. public int $type;
  13. /** @var mixed Is null for add operations */
  14. public $old;
  15. /** @var mixed Is null for remove operations */
  16. public $new;
  17. /**
  18. * @param int $type One of the TYPE_* constants
  19. * @param mixed $old Is null for add operations
  20. * @param mixed $new Is null for remove operations
  21. */
  22. public function __construct(int $type, $old, $new) {
  23. $this->type = $type;
  24. $this->old = $old;
  25. $this->new = $new;
  26. }
  27. }