Completed
Push — master ( fbc42e...4f026e )
by Jonas
21:13
created

RateLimitException   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 32
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getSecondsToWait() 0 4 1
1
<?php
2
declare(strict_types=1);
3
4
/*
5
 * This file is part of SteamScore.
6
 *
7
 * (c) SteamScore <[email protected]>
8
 *
9
 * This Source Code Form is subject to the terms of the Mozilla Public
10
 * License, v. 2.0. If a copy of the MPL was not distributed with this
11
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
12
 */
13
14
namespace SteamScore\Api\Domain\Exceptions;
15
16
use Exception;
17
use Throwable;
18
19
final class RateLimitException extends Exception
20
{
21
    /**
22
     * @var float
23
     */
24
    private $secondsToWait;
25
26
    /**
27
     * Constructor.
28
     *
29
     * @param float     $secondsToWait
30
     * @param string    $message
31
     * @param int       $code
32
     * @param Throwable $previous
33
     */
34
    public function __construct(float $secondsToWait, string $message = '', int $code = 0, Throwable $previous = null)
35
    {
36
        parent::__construct($message, $code, $previous);
37
38
        $this->secondsToWait = $secondsToWait;
39
    }
40
41
    /**
42
     * Gets seconds to wait.
43
     *
44
     * @return float
45
     */
46
    public function getSecondsToWait(): float
47
    {
48
        return $this->secondsToWait;
49
    }
50
}
51