Diff.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <?php
  2. /*
  3. * This file is part of sebastian/diff.
  4. *
  5. * (c) Sebastian Bergmann <sebastian@phpunit.de>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace PhpCsFixer\Diff\v2_0;
  11. final class Diff
  12. {
  13. /**
  14. * @var string
  15. */
  16. private $from;
  17. /**
  18. * @var string
  19. */
  20. private $to;
  21. /**
  22. * @var Chunk[]
  23. */
  24. private $chunks;
  25. /**
  26. * @param string $from
  27. * @param string $to
  28. * @param Chunk[] $chunks
  29. */
  30. public function __construct($from, $to, array $chunks = [])
  31. {
  32. $this->from = $from;
  33. $this->to = $to;
  34. $this->chunks = $chunks;
  35. }
  36. public function getFrom()
  37. {
  38. return $this->from;
  39. }
  40. public function getTo()
  41. {
  42. return $this->to;
  43. }
  44. /**
  45. * @return Chunk[]
  46. */
  47. public function getChunks()
  48. {
  49. return $this->chunks;
  50. }
  51. /**
  52. * @param Chunk[] $chunks
  53. */
  54. public function setChunks(array $chunks)
  55. {
  56. $this->chunks = $chunks;
  57. }
  58. }