TestSize.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <?php declare(strict_types=1);
  2. /*
  3. * This file is part of phpunit/php-code-coverage.
  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\CodeCoverage\Test\TestSize;
  11. /**
  12. * @psalm-immutable
  13. */
  14. abstract class TestSize
  15. {
  16. public static function unknown(): self
  17. {
  18. return new Unknown;
  19. }
  20. public static function small(): self
  21. {
  22. return new Small;
  23. }
  24. public static function medium(): self
  25. {
  26. return new Medium;
  27. }
  28. public static function large(): self
  29. {
  30. return new Large;
  31. }
  32. /**
  33. * @psalm-assert-if-true Known $this
  34. */
  35. public function isKnown(): bool
  36. {
  37. return false;
  38. }
  39. /**
  40. * @psalm-assert-if-true Unknown $this
  41. */
  42. public function isUnknown(): bool
  43. {
  44. return false;
  45. }
  46. /**
  47. * @psalm-assert-if-true Small $this
  48. */
  49. public function isSmall(): bool
  50. {
  51. return false;
  52. }
  53. /**
  54. * @psalm-assert-if-true Medium $this
  55. */
  56. public function isMedium(): bool
  57. {
  58. return false;
  59. }
  60. /**
  61. * @psalm-assert-if-true Large $this
  62. */
  63. public function isLarge(): bool
  64. {
  65. return false;
  66. }
  67. abstract public function asString(): string;
  68. }