Passed
Push — master ( 5649e5...cd00c2 )
by Joshua
05:29 queued 03:33
created

RateLimitException   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 8
dl 0
loc 37
ccs 9
cts 9
cp 1
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
/*
6
 * This file is part of the -SeamsCMSDeliverySdk package.
7
 *
8
 * (c) Seams-CMS.com
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
namespace SeamsCMS\Delivery\Exception;
15
16
class RateLimitException extends BaseException implements SeamsCMSException
17
{
18
    /** @var int */
19
    protected $limit;
20
21
    /** @var int */
22
    protected $resetTimestamp;
23
24
    /**
25
     * RateLimitException constructor.
26
     *
27
     * @param int $limit
28
     * @param int $resetTimestamp
29
     * @param string $msg
30
     */
31 1
    public function __construct(int $limit, int $resetTimestamp, string $msg)
32
    {
33 1
        $this->limit = $limit;
34 1
        $this->resetTimestamp = $resetTimestamp;
35
36 1
        parent::__construct($msg);
37 1
    }
38
39
    /**
40
     * @return int
41
     */
42 1
    public function getLimit(): int
43
    {
44 1
        return $this->limit;
45
    }
46
47
    /**
48
     * @return int
49
     */
50 1
    public function getResetTimestamp(): int
51
    {
52 1
        return $this->resetTimestamp;
53
    }
54
}
55