Completed
Push — custom-comb ( 5e8785...1f8dae )
by Marcel
34:36
created

CombGenerator::getOverflowDate()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 8
ccs 5
cts 5
cp 1
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 5
nc 2
nop 0
crap 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace UMA\Uuid;
6
7
/**
8
 * @see http://www.informit.com/articles/article.aspx?p=25862
9
 */
10
class CombGenerator extends CustomCombGenerator
11
{
12
    /**
13
     * @param int $granularity Precision of the timestamps, ranging from second up to microsecond.
14
     *
15
     * @throws \InvalidArgumentException When $granularity is outside the [0, 6] range.
16
     */
17 8
    public function __construct(int $granularity = 6)
18
    {
19 8
        parent::__construct(
20 8
            new Version4Generator,
21 8
            new \DateTimeImmutable('1970-01-01 00:00:00 UTC'),
22 8
            6, $granularity
23
        );
24 7
    }
25
}
26