Passed
Push — master ( 9b3de9...1884c9 )
by Marcel
05:40
created

GeneratorBench::benchVersion1Generator()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
use UMA\Uuid\Uuid;
4
use UMA\Uuid\CombGenerator;
5
use UMA\Uuid\Version1Generator;
6
use UMA\Uuid\Version4Generator;
7
use UMA\Uuid\Version5Generator;
8
9
/**
10
 * @Revs(100000)
11
 * @Iterations(5)
12
 */
13
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...
14
{
15
    /**
16
     * @var CombGenerator
17
     */
18
    private $comb;
19
20
    /**
21
     * @var Version1Generator
22
     */
23
    private $v1;
24
25
    /**
26
     * @var Version4Generator
27
     */
28
    private $v4;
29
30
    /**
31
     * @var Version5Generator
32
     */
33
    private $v5;
34
35
    public function __construct()
36
    {
37
        $this->comb = new CombGenerator;
38
        $this->v1 = new Version1Generator('01:23:45:67:89:ab');
39
        $this->v4 = new Version4Generator;
40
        $this->v5 = new Version5Generator(Uuid::nil());
41
    }
42
43
    public function benchCombGenerator()
44
    {
45
        $this->comb->generate();
46
    }
47
48
    public function benchVersion1Generator()
49
    {
50
        $this->v1->generate();
51
    }
52
53
    public function benchVersion4Generator()
54
    {
55
        $this->v4->generate();
56
    }
57
58
    public function benchVersion5Generator()
59
    {
60
        $this->v5->generate('foo');
61
    }
62
}
63