RoundingMode.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. if (\PHP_VERSION_ID < 80100) {
  11. final class RoundingMode
  12. {
  13. const HalfAwayFromZero = 0;
  14. const HalfTowardsZero = 1;
  15. const HalfEven = 2;
  16. const HalfOdd = 3;
  17. const TowardsZero = 4;
  18. const AwayFromZero = 5;
  19. const NegativeInfinity = 6;
  20. const PositiveInfinity = 7;
  21. private function __construct()
  22. {
  23. }
  24. public static function cases(): array
  25. {
  26. return [
  27. self::HalfAwayFromZero,
  28. self::HalfTowardsZero,
  29. self::HalfEven,
  30. self::HalfOdd,
  31. self::TowardsZero,
  32. self::AwayFromZero,
  33. self::NegativeInfinity,
  34. self::PositiveInfinity,
  35. ];
  36. }
  37. }
  38. } elseif (\PHP_VERSION_ID < 80400) {
  39. require dirname(__DIR__).'/RoundingMode.php';
  40. }