Нема описа

DateTimeDefaultPrecision.php 767B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. /**
  3. * This file is part of the Carbon package.
  4. *
  5. * (c) Brian Nesbitt <brian@nesbot.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 Carbon\Doctrine;
  11. class DateTimeDefaultPrecision
  12. {
  13. private static $precision = 6;
  14. /**
  15. * Change the default Doctrine datetime and datetime_immutable precision.
  16. *
  17. * @param int $precision
  18. */
  19. public static function set(int $precision): void
  20. {
  21. self::$precision = $precision;
  22. }
  23. /**
  24. * Get the default Doctrine datetime and datetime_immutable precision.
  25. *
  26. * @return int
  27. */
  28. public static function get(): int
  29. {
  30. return self::$precision;
  31. }
  32. }