Diff.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <?php
  2. /*
  3. * This file is part of the Diff package.
  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 SebastianBergmann\Diff;
  11. /**
  12. * @package Diff
  13. * @author Sebastian Bergmann <sebastian@phpunit.de>
  14. * @author Kore Nordmann <mail@kore-nordmann.de>
  15. * @copyright Sebastian Bergmann <sebastian@phpunit.de>
  16. * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License
  17. * @link http://www.github.com/sebastianbergmann/diff
  18. */
  19. class Diff
  20. {
  21. /**
  22. * @var string
  23. */
  24. private $from;
  25. /**
  26. * @var string
  27. */
  28. private $to;
  29. /**
  30. * @var Chunk[]
  31. */
  32. private $chunks;
  33. /**
  34. * @param string $from
  35. * @param string $to
  36. * @param Chunk[] $chunks
  37. */
  38. public function __construct($from, $to, array $chunks = array())
  39. {
  40. $this->from = $from;
  41. $this->to = $to;
  42. $this->chunks = $chunks;
  43. }
  44. /**
  45. * @return string
  46. */
  47. public function getFrom()
  48. {
  49. return $this->from;
  50. }
  51. /**
  52. * @return string
  53. */
  54. public function getTo()
  55. {
  56. return $this->to;
  57. }
  58. /**
  59. * @return Chunk[]
  60. */
  61. public function getChunks()
  62. {
  63. return $this->chunks;
  64. }
  65. /**
  66. * @param Chunk[] $chunks
  67. */
  68. public function setChunks(array $chunks)
  69. {
  70. $this->chunks = $chunks;
  71. }
  72. }