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

CombGenerator::procrust()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
crap 1
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