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 ( 7f68f8...aed5c0 )
by Cees-Jan
07:41
created

XmlRpcPayloadParser::parse()   C

Complexity

Conditions 8
Paths 8

Size

Total Lines 32
Code Lines 16

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 32
rs 5.3846
c 0
b 0
f 0
cc 8
eloc 16
nc 8
nop 1
1
<?php declare(strict_types=1);
2
3
namespace ApiClients\Tools\Services\XmlRpc;
4
5
use DateTimeImmutable;
6
7
final class XmlRpcPayloadParser
8
{
9
    public static function parse(array $xml)
10
    {
11
        if (isset($xml['string'])) {
12
            return $xml['string'];
13
        }
14
15
        if (isset($xml['base64'])) {
16
            return base64_decode($xml['base64'], true);
17
        }
18
19
        if (isset($xml['i4'])) {
20
            return (int)$xml['i4'];
21
        }
22
23
        if (isset($xml['int'])) {
24
            return (int)$xml['int'];
25
        }
26
27
        if (isset($xml['double'])) {
28
            return (float)$xml['double'];
29
        }
30
31
        if (isset($xml['boolean'])) {
32
            return (bool)$xml['boolean'];
33
        }
34
35
        if (isset($xml['dateTime.iso8601'])) {
36
            return new DateTimeImmutable($xml['dateTime.iso8601']);
37
        }
38
39
        return $xml;
40
    }
41
}
42