GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( 9a7ea4...53d770 )
by Yang
02:32
created

MnsException   A

Complexity

Total Complexity 10

Size/Duplication

Total Lines 60
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 10
c 2
b 0
f 0
lcom 0
cbo 0
dl 0
loc 60
rs 10
1
<?php
2
namespace AliyunMNS\Exception;
3
4
class MnsException extends \RuntimeException
5
{
6
    private $mnsErrorCode;
7
    private $requestId;
8
    private $hostId;
9
10
    public function __construct($code, $message, $previousException = NULL, $mnsErrorCode = NULL, $requestId = NULL, $hostId = NULL)
11
    {
12
        parent::__construct($message, $code, $previousException);
13
14
        if ($mnsErrorCode == NULL)
15
        {
16
            if ($code >= 500)
17
            {
18
                $mnsErrorCode = "ServerError";
19
            }
20
            else
21
            {
22
                $mnsErrorCode = "ClientError";
23
            }
24
        }
25
        $this->mnsErrorCode = $mnsErrorCode;
26
27
        $this->requestId = $requestId;
28
        $this->hostId = $hostId;
29
    }
30
31
    public function __toString()
32
    {
33
        $str = "Code: " . $this->getCode() . " Message: " . $this->getMessage();
34
        if ($this->mnsErrorCode != NULL)
35
        {
36
            $str .= " MnsErrorCode: " . $this->mnsErrorCode;
37
        }
38
        if ($this->requestId != NULL)
39
        {
40
            $str .= " RequestId: " . $this->requestId;
41
        }
42
        if ($this->hostId != NULL)
43
        {
44
            $str .= " HostId: " . $this->hostId;
45
        }
46
        return $str;
47
    }
48
49
    public function getMnsErrorCode()
50
    {
51
        return $this->mnsErrorCode;
52
    }
53
54
    public function getRequestId()
55
    {
56
        return $this->requestId;
57
    }
58
59
    public function getHostId()
60
    {
61
        return $this->hostId;
62
    }
63
}
64
65
?>
66