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

XMLParser   A

Complexity

Total Complexity 11

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 44
rs 10
c 0
b 0
f 0
wmc 11
1
<?php
2
namespace AliyunMNS\Common;
3
4
class XMLParser
5
{
6
    /**
7
     * Most of the error responses are in same format.
8
     */
9
    static function parseNormalError(\XMLReader $xmlReader) {
10
        $result = array('Code' => NULL, 'Message' => NULL, 'RequestId' => NULL, 'HostId' => NULL);
11
        while ($xmlReader->Read())
12
        {
13
            if ($xmlReader->nodeType == \XMLReader::ELEMENT)
14
            {
15
                switch ($xmlReader->name) {
16
                case 'Code':
17
                    $xmlReader->read();
18
                    if ($xmlReader->nodeType == \XMLReader::TEXT)
19
                    {
20
                        $result['Code'] = $xmlReader->value;
21
                    }
22
                    break;
23
                case 'Message':
24
                    $xmlReader->read();
25
                    if ($xmlReader->nodeType == \XMLReader::TEXT)
26
                    {
27
                        $result['Message'] = $xmlReader->value;
28
                    }
29
                    break;
30
                case 'RequestId':
31
                    $xmlReader->read();
32
                    if ($xmlReader->nodeType == \XMLReader::TEXT)
33
                    {
34
                        $result['RequestId'] = $xmlReader->value;
35
                    }
36
                    break;
37
                case 'HostId':
38
                    $xmlReader->read();
39
                    if ($xmlReader->nodeType == \XMLReader::TEXT)
40
                    {
41
                        $result['HostId'] = $xmlReader->value;
42
                    }
43
                    break;
44
                }
45
            }
46
        }
47
        return $result;
48
    }
49
}
50
51
?>
52