Passed
Push — master ( 876065...f10f6d )
by Kevin
01:15
created

UnlimitedStore::status()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

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