Passed
Push — master ( ccfde0...23ae65 )
by Petr
09:08
created

UniqueId   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
dl 0
loc 15
ccs 7
cts 7
cp 1
rs 10
c 1
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A get() 0 5 1
A clear() 0 4 1
1
<?php
2
3
namespace kalanis\kw_mapper\Storage\Shared\QueryBuilder;
4
5
6
class UniqueId
7
{
8
    protected int $id = 0;
9
10 76
    public function get(): int
11
    {
12 76
        $id = $this->id;
13 76
        $this->id++;
14 76
        return $id;
15
    }
16
17 39
    public function clear(): self
18
    {
19 39
        $this->id = 0;
20 39
        return $this;
21
    }
22
}
23