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.
Passed
Branch master (b10c57)
by milkmeowo
02:58
created

DeleteMessageErrorItem   A

Complexity

Total Complexity 15

Size/Duplication

Total Lines 74
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 74
rs 10
c 0
b 0
f 0
wmc 15
1
<?php
2
namespace AliyunMNS\Model;
3
4
use AliyunMNS\Constants;
5
6
class DeleteMessageErrorItem
7
{
8
    protected $errorCode;
9
    protected $errorMessage;
10
    protected $receiptHandle;
11
12
    public function __construct($errorCode, $errorMessage, $receiptHandle)
13
    {
14
        $this->errorCode = $errorCode;
15
        $this->errorMessage = $errorMessage;
16
        $this->receiptHandle = $receiptHandle;
17
    }
18
19
    public function getErrorCode()
20
    {
21
        return $this->errorCode;
22
    }
23
24
    public function getErrorMessage()
25
    {
26
        return $this->errorMessage;
27
    }
28
29
    public function getReceiptHandle()
30
    {
31
        return $this->receiptHandle;
32
    }
33
34
    static public function fromXML($xmlReader)
35
    {
36
        $errorCode = NULL;
37
        $errorMessage = NULL;
38
        $receiptHandle = NULL;
39
40
        while ($xmlReader->read())
41
        {
42
            switch ($xmlReader->nodeType)
43
            {
44
            case \XMLReader::ELEMENT:
45
                switch ($xmlReader->name)
46
                {
47
                case Constants::ERROR_CODE:
48
                    $xmlReader->read();
49
                    if ($xmlReader->nodeType == \XMLReader::TEXT)
50
                    {
51
                        $errorCode = $xmlReader->value;
52
                    }
53
                    break;
54
                case Constants::ERROR_MESSAGE:
55
                    $xmlReader->read();
56
                    if ($xmlReader->nodeType == \XMLReader::TEXT)
57
                    {
58
                        $errorMessage = $xmlReader->value;
59
                    }
60
                    break;
61
                case Constants::RECEIPT_HANDLE:
62
                    $xmlReader->read();
63
                    if ($xmlReader->nodeType == \XMLReader::TEXT)
64
                    {
65
                        $receiptHandle = $xmlReader->value;
66
                    }
67
                    break;
68
                }
69
                break;
70
            case \XMLReader::END_ELEMENT:
71
                if ($xmlReader->name == Constants::ERROR)
72
                {
73
                    return new DeleteMessageErrorItem($errorCode, $errorMessage, $receiptHandle);
74
                }
75
                break;
76
            }
77
        }
78
79
        return new DeleteMessageErrorItem($errorCode, $errorMessage, $receiptHandle);
80
    }
81
}
82
83
?>
84