Passed
Pull Request — master (#346)
by
unknown
02:08
created

RequestComment::setIsPublic()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 4
rs 10
1
<?php
2
3
namespace JiraRestApi\Request;
4
5
class RequestComment implements \JsonSerializable
6
{
7
    /** @var string */
8
    public $id;
9
10
    /** @var string */
11
    public $body;
12
13
    /** @var boolean */
14
    public $public;
15
16
    /** @var \JiraRestApi\Request\Author */
17
    public $author;
18
19
    /** @var \DateTimeInterface */
20
    public $created;
21
22
    /**
23
     * @param string $body
24
     * @return $this
25
     */
26
    public function setBody(string $body)
27
    {
28
        $this->body = $body;
29
        return $this;
30
    }
31
32
    /**
33
     * @param boolean $public   True for is public, false otherwise
34
     * @return $this
35
     */
36
    public function setIsPublic(bool $public)
37
    {
38
        $this->public = $public;
39
        return $this;
40
    }
41
42
    public function jsonSerialize()
43
    {
44
        return array_filter(get_object_vars($this), function($var) {
45
            return $var !== null;
46
        });
47
    }
48
}
49