UnlimitedStore   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 3
eloc 3
c 1
b 0
f 1
dl 0
loc 14
rs 10
ccs 5
cts 5
cp 1

3 Methods

Rating   Name   Duplication   Size   Complexity  
A hit() 0 3 1
A status() 0 3 1
A reset() 0 2 1
1
<?php
2
3
namespace Zenstruck\Governator\Store;
4
5
use Zenstruck\Governator\Counter;
6
use Zenstruck\Governator\Key;
7
use Zenstruck\Governator\Store;
8
9
/**
10
 * @author Kevin Bond <[email protected]>
11
 */
12
final class UnlimitedStore implements Store
13
{
14 3
    public function hit(Key $key): Counter
15
    {
16 3
        return new Counter(1, time() + $key->ttl());
17
    }
18
19 1
    public function status(Key $key): Counter
20
    {
21 1
        return $key->createCounter();
22
    }
23
24 1
    public function reset(Key $key): void
25
    {
26
        // noop
27 1
    }
28
}
29