Completed
Push — master ( 699478...5c97e7 )
by Dan Michael O.
02:26
created

UsageLimitExceeded   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 1
dl 0
loc 21
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getReason() 0 4 1
1
<?php
2
3
namespace Scriptotek\GoogleBooks\Exceptions;
4
5
class UsageLimitExceeded extends GoogleApiException
6
{
7
    /** @var string Reason can be any of:
8
       - 'dailyLimitExceeded' : The Courtesy API limit for your project has been reached.
9
       - 'userRateLimitExceeded': The per-user limit from the Developer Console has been reached.
10
       - 'userRateLimitExceededUnreg': Limit when unregistered
11
       - More?
12
    */
13
    private $reason;
14
15
    public function __construct($message, $reason)
16
    {
17
        parent::__construct($message);
18
        $this->reason = $reason;
19
    }
20
21
    public function getReason()
22
    {
23
        return $this->reason;
24
    }
25
}
26