RateLimitedReached   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 66.67%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 16
ccs 4
cts 6
cp 0.6667
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getResponse() 0 4 1
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