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

UniqueId::clear()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

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