Passed
Push — master ( 443842...86f0b2 )
by Joshua
05:55 queued 01:59
created

RateLimitException   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 8
dl 0
loc 37
ccs 0
cts 13
cp 0
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getLimit() 0 3 1
A getResetTimestamp() 0 3 1
A __construct() 0 6 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace SeamsCMS\Delivery\Exception;
6
7
class RateLimitException extends BaseException implements SeamsCMSException
8
{
9
    /** @var int */
10
    protected $limit;
11
12
    /** @var int */
13
    protected $resetTimestamp;
14
15
    /**
16
     * RateLimitException constructor.
17
     *
18
     * @param int $limit
19
     * @param int $resetTimestamp
20
     * @param string $msg
21
     */
22
    public function __construct(int $limit, int $resetTimestamp, string $msg)
23
    {
24
        $this->limit = $limit;
25
        $this->resetTimestamp = $resetTimestamp;
26
27
        parent::__construct($msg);
28
    }
29
30
    /**
31
     * @return int
32
     */
33
    public function getLimit(): int
34
    {
35
        return $this->limit;
36
    }
37
38
    /**
39
     * @return int
40
     */
41
    public function getResetTimestamp(): int
42
    {
43
        return $this->resetTimestamp;
44
    }
45
}
46