Completed
Push — master ( fdbba1...422a5d )
by Agaletskiy
06:02 queued 03:57
created

RateLimit::getKey()   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
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Lamoda\Tactician\RateLimit\RateLimiter;
6
7
final class RateLimit
8
{
9
    /**
10
     * @var string
11
     */
12
    private $key;
13
    /**
14
     * @var int
15
     */
16
    private $limit;
17
    /**
18
     * @var int
19
     */
20
    private $milliseconds;
21
22 3
    public function __construct(string $key, int $limit, int $milliseconds)
23
    {
24 3
        $this->key = $key;
25 3
        $this->limit = $limit;
26 3
        $this->milliseconds = $milliseconds;
27 3
    }
28
29
    /**
30
     * @return string
31
     */
32 2
    public function getKey(): string
33
    {
34 2
        return $this->key;
35
    }
36
37
    /**
38
     * @return int
39
     */
40 2
    public function getLimit(): int
41
    {
42 2
        return $this->limit;
43
    }
44
45
    /**
46
     * @return int
47
     */
48 2
    public function getMilliseconds(): int
49
    {
50 2
        return $this->milliseconds;
51
    }
52
}
53