Completed
Pull Request — master (#77)
by Michal
01:40
created

RateLimitResponse::getRemaining()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 2
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
    public function __construct(int $limit, int $remaining, ?int $retryAfter = null, ?IResponse $errorResponse = null)
18
    {
19
        $this->limit = $limit;
20
        $this->remaining = $remaining;
21
        $this->retryAfter = $retryAfter;
22
        $this->errorResponse = $errorResponse;
23
    }
24
25
    public function getLimit(): int
26
    {
27
        return $this->limit;
28
    }
29
30
    public function getRemaining(): int
31
    {
32
        return $this->remaining;
33
    }
34
35
    public function getRetryAfter(): ?int
36
    {
37
        return $this->retryAfter;
38
    }
39
40
    public function getErrorResponse(): ?IResponse
41
    {
42
        return $this->errorResponse;
43
    }
44
}
45