Completed
Push — master ( 98e0f8...788820 )
by Tomas
29s queued 12s
created

RateLimitResponse::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 7
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 4
crap 1
1
<?php
2
3
namespace Tomaj\NetteApi\RateLimit;
4
5
use Nette\Application\IResponse;
6
7
class RateLimitResponse
8
{
9
    private $limit;
10
11
    private $remaining;
12
13
    private $retryAfter;
14
15
    private $errorResponse;
16
17 3
    public function __construct(int $limit, int $remaining, ?int $retryAfter = null, ?IResponse $errorResponse = null)
18
    {
19 3
        $this->limit = $limit;
20 3
        $this->remaining = $remaining;
21 3
        $this->retryAfter = $retryAfter;
22 3
        $this->errorResponse = $errorResponse;
23 3
    }
24
25 3
    public function getLimit(): int
26
    {
27 3
        return $this->limit;
28
    }
29
30 3
    public function getRemaining(): int
31
    {
32 3
        return $this->remaining;
33
    }
34
35 3
    public function getRetryAfter(): ?int
36
    {
37 3
        return $this->retryAfter;
38
    }
39
40 3
    public function getErrorResponse(): ?IResponse
41
    {
42 3
        return $this->errorResponse;
43
    }
44
}
45