ConstraintTraitForV7.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  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 Symfony\Bridge\PhpUnit\Legacy;
  11. use SebastianBergmann\Exporter\Exporter;
  12. /**
  13. * @internal
  14. */
  15. trait ConstraintTraitForV7
  16. {
  17. use ConstraintLogicTrait;
  18. /**
  19. * @return bool|null
  20. */
  21. public function evaluate($other, $description = '', $returnResult = false)
  22. {
  23. return $this->doEvaluate($other, $description, $returnResult);
  24. }
  25. public function count(): int
  26. {
  27. return $this->doCount();
  28. }
  29. public function toString(): string
  30. {
  31. return $this->doToString();
  32. }
  33. protected function additionalFailureDescription($other): string
  34. {
  35. return $this->doAdditionalFailureDescription($other);
  36. }
  37. protected function exporter(): Exporter
  38. {
  39. if (null === $this->exporter) {
  40. $this->exporter = new Exporter();
  41. }
  42. return $this->exporter;
  43. }
  44. protected function failureDescription($other): string
  45. {
  46. return $this->doFailureDescription($other);
  47. }
  48. protected function matches($other): bool
  49. {
  50. return $this->doMatches($other);
  51. }
  52. }