Completed
Push — custom-comb ( be736d...ea4943 )
by Marcel
03:33
created

GeneratorBench::benchVersion5Generator()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
use UMA\Uuid\Uuid;
6
use UMA\Uuid\CombGenerator;
7
use UMA\Uuid\Version1Generator;
8
use UMA\Uuid\Version4Generator;
9
use UMA\Uuid\Version5Generator;
10
11
class GeneratorBench
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
12
{
13
    /**
14
     * @var CombGenerator
15
     */
16
    private $comb;
17
18
    /**
19
     * @var Version1Generator
20
     */
21
    private $v1;
22
23
    /**
24
     * @var Version4Generator
25
     */
26
    private $v4;
27
28
    /**
29
     * @var Version5Generator
30
     */
31
    private $v5;
32
33
    public function __construct()
34
    {
35
        $this->comb = new CombGenerator;
36
        $this->v1 = new Version1Generator('01:23:45:67:89:ab');
37
        $this->v4 = new Version4Generator;
38
        $this->v5 = new Version5Generator(Uuid::nil());
39
    }
40
41
    public function benchCombGenerator()
42
    {
43
        $this->comb->generate();
44
    }
45
46
    public function benchVersion1Generator()
47
    {
48
        $this->v1->generate();
49
    }
50
51
    public function benchVersion4Generator()
52
    {
53
        $this->v4->generate();
54
    }
55
56
    public function benchVersion5Generator()
57
    {
58
        $this->v5->generate('foo');
59
    }
60
}
61