RateLimitedReached::getResponse()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 2
1
<?php
2
3
/*
4
 * This file is part of the Pinterest PHP library.
5
 *
6
 * (c) Hans Ott <[email protected]>
7
 *
8
 * This source file is subject to the MIT license that is bundled
9
 * with this source code in the file LICENSE.md.
10
 *
11
 * Source: https://github.com/hansott/pinterest-php
12
 */
13
14
namespace Pinterest\Http\Exceptions;
15
16
use Pinterest\Http\Response;
17
18
/**
19
 * This exception will be thrown when the rate limit is reached.
20
 *
21
 * @author Toon Daelman <[email protected]>
22
 */
23
final class RateLimitedReached extends \Exception
24
{
25
    private $response;
26
27 19
    public function __construct(Response $response)
28
    {
29 19
        $this->response = $response;
30
31 19
        parent::__construct('Rate limit reached.');
32 19
    }
33
34
    public function getResponse()
35
    {
36
        return $this->response;
37
    }
38
}
39