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.

Visibility::setType()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
namespace JiraRestApi\Issue;
4
5
class Visibility
6
{
7
    public $type;
8
    public $value;
9
10
    public function setType($type)
11
    {
12
        $this->type = $type;
13
    }
14
15
    public function setValue($value)
16
    {
17
        $this->value = $value;
18
    }
19
20
    public function getType()
21
    {
22
        return $this->type;
23
    }
24
25
    public function getValue()
26
    {
27
        return $this->value;
28
    }
29
}
30
31
class Comment implements \JsonSerializable
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class should be in its own file to aid autoloaders.

Having each class in a dedicated file usually plays nice with PSR autoloaders and is therefore a well established practice. If you use other autoloaders, you might not want to follow this rule.

Loading history...
32
{
33
    /**
34
     * @var string
35
     */
36
    public $self;
37
38
    /**
39
     * @var string
40
     */
41
    public $id;
42
43
    /**
44
     * @var \JiraRestApi\Issue\Reporter
45
     */
46
    public $author;
47
48
    /**
49
     * @var string
50
     */
51
    public $body;
52
53
    /**
54
     * @var \JiraRestApi\Issue\Reporter
55
     */
56
    public $updateAuthor;
57
58
    /**
59
     * @var \DateTime
60
     */
61
    public $created;
62
63
    /**
64
     * @var \DateTime
65
     */
66
    public $updated;
67
68
    /**
69
     * @var \JiraRestApi\Issue\Visibility
70
     */
71
    public $visibility;
72
73
    public function setId($id)
74
    {
75
        $this->id = $id;
76
        return $this;
77
    }
78
79
    public function setBody($body)
80
    {
81
        $this->body = $body;
82
        return $this;
83
    }
84
85
    public function setVisibility($visibility, $value = null)
86
    {
87
        if(is_string($visibility) && is_string($value)) {
88
            $visibility = ['type' => $visibility, 'value' => $value];
89
        }
90
91
        if (is_null($this->visibility)) {
92
            $this->visibility = new Visibility();
93
        }
94
95
        $visibility = (array) $visibility;
96
97
        $this->visibility->setType($visibility['type']);
98
        $this->visibility->setValue($visibility['value']);
99
100
        return $this;
101
    }
102
103
    public function jsonSerialize()
104
    {
105
        return array_filter(get_object_vars($this));
106
    }
107
}
108