blob: 642fd41354b8064dc5991d7e04dcd5377953db79 [file] [log] [blame]
Matthias Andreas Benkard7b2a3a12021-08-16 10:57:25 +02001<?php
2
3/**
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +01004 * This file is part of the Carbon package.
5 *
6 * (c) Brian Nesbitt <brian@nesbot.com>
7 *
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
Matthias Andreas Benkard7b2a3a12021-08-16 10:57:25 +020010 */
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +010011
Matthias Andreas Benkard7b2a3a12021-08-16 10:57:25 +020012namespace Carbon\Doctrine;
13
14class DateTimeDefaultPrecision
15{
16 private static $precision = 6;
17
18 /**
19 * Change the default Doctrine datetime and datetime_immutable precision.
20 *
21 * @param int $precision
22 */
23 public static function set(int $precision): void
24 {
25 self::$precision = $precision;
26 }
27
28 /**
29 * Get the default Doctrine datetime and datetime_immutable precision.
30 *
31 * @return int
32 */
33 public static function get(): int
34 {
35 return self::$precision;
36 }
37}