Completed
Push — master ( 765a46...8c9912 )
by Hector
03:05
created

RateLimit::getRetryAfter()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
c 1
b 1
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace Hborras\TwitterAdsSDK\TwitterAds\Errors;
4
5
use Exception;
6
use Hborras\TwitterAdsSDK\TwitterAdsException;
7
8
class RateLimit extends TwitterAdsException
9
{
10
    private $retryAfter;
11
    private $resetAt;
12
13
    public function __construct($message, $code, Exception $previous = null, $errors, $headers)
14
    {
15
        parent::__construct($message, $code, null, $errors);
16
        $this->retryAfter = $headers['retry-after'];
17
        $this->resetAt = $headers['rate_limit_reset'];
18
    }
19
20
    /**
21
     * @return mixed
22
     */
23
    public function getRetryAfter()
24
    {
25
        return $this->retryAfter;
26
    }
27
28
    /**
29
     * @return mixed
30
     */
31
    public function getResetAt()
32
    {
33
        return $this->resetAt;
34
    }
35
}
36