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

RateLimitResponse   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 5
lcom 0
cbo 0
dl 0
loc 38
ccs 14
cts 14
cp 1
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A getLimit() 0 4 1
A getRemaining() 0 4 1
A getRetryAfter() 0 4 1
A getErrorResponse() 0 4 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