Line.php 848 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php declare(strict_types=1);
  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 SebastianBergmann\Diff;
  11. final class Line
  12. {
  13. public const ADDED = 1;
  14. public const REMOVED = 2;
  15. public const UNCHANGED = 3;
  16. /**
  17. * @var int
  18. */
  19. private $type;
  20. /**
  21. * @var string
  22. */
  23. private $content;
  24. public function __construct(int $type = self::UNCHANGED, string $content = '')
  25. {
  26. $this->type = $type;
  27. $this->content = $content;
  28. }
  29. public function getContent(): string
  30. {
  31. return $this->content;
  32. }
  33. public function getType(): int
  34. {
  35. return $this->type;
  36. }
  37. }