ReplaceResult.php 742 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. /*
  3. * This file is part of composer/pcre.
  4. *
  5. * (c) Composer <https://github.com/composer>
  6. *
  7. * For the full copyright and license information, please view
  8. * the LICENSE file that was distributed with this source code.
  9. */
  10. namespace Composer\Pcre;
  11. final class ReplaceResult
  12. {
  13. /**
  14. * @readonly
  15. * @var string
  16. */
  17. public $result;
  18. /**
  19. * @readonly
  20. * @var 0|positive-int
  21. */
  22. public $count;
  23. /**
  24. * @readonly
  25. * @var bool
  26. */
  27. public $matched;
  28. /**
  29. * @param 0|positive-int $count
  30. */
  31. public function __construct(int $count, string $result)
  32. {
  33. $this->count = $count;
  34. $this->matched = (bool) $count;
  35. $this->result = $result;
  36. }
  37. }