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
Pull Request — master (#1)
by Pascal
02:17
created

Error   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 63
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 63
ccs 11
cts 11
cp 1
rs 10
c 0
b 0
f 0
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getCode() 0 3 1
A getType() 0 3 1
A __construct() 0 5 1
A getMessage() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Saikootau\ApiBundle\Resource;
6
7
use JMS\Serializer\Annotation as Serializer;
8
9
/**
10
 * @Serializer\XmlRoot("error")
11
 */
12
class Error
13
{
14
    /**
15
     * @Serializer\XmlAttribute
16
     * @Serializer\SerializedName("type")
17
     * @Serializer\Type("string")
18
     *
19
     * @var string
20
     */
21
    private $type;
22
23
    /**
24
     * @Serializer\XmlAttribute
25
     * @Serializer\SerializedName("code")
26
     * @Serializer\Type("string")
27
     *
28
     * @var string|null
29
     */
30
    private $code;
31
32
    /**
33
     * @Serializer\XmlValue
34
     * @Serializer\Type("string")
35
     *
36
     * @var string
37
     */
38
    private $message;
39
40 10
    public function __construct(string $type, string $message, ?string $code = null)
41
    {
42 10
        $this->type = $type;
43 10
        $this->code = $code;
44 10
        $this->message = $message;
45 10
    }
46
47
    /**
48
     * Return the error type. Normally the exception name.
49
     *
50
     * @return string
51
     */
52 4
    public function getType(): string
53
    {
54 4
        return $this->type;
55
    }
56
57
    /**
58
     * Return an error code, if present.
59
     *
60
     * @return string|null
61
     */
62 3
    public function getCode(): ?string
63
    {
64 3
        return $this->code;
65
    }
66
67
    /**
68
     * Returns the message for this error.
69
     *
70
     * @return string
71
     */
72 6
    public function getMessage(): string
73
    {
74 6
        return $this->message;
75
    }
76
}
77