Passed
Push — master ( 9e7fa6...c5d7ac )
by KwangSeob
03:35
created

RequestComment::setBody()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
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 5
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 bool */
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
     *
25
     * @return $this
26
     */
27
    public function setBody(string $body)
28
    {
29
        $this->body = $body;
30
31
        return $this;
32
    }
33
34
    /**
35
     * @param bool $public True for is public, false otherwise
36
     *
37
     * @return $this
38
     */
39
    public function setIsPublic(bool $public)
40
    {
41
        $this->public = $public;
42
43
        return $this;
44
    }
45
46
    public function jsonSerialize()
47
    {
48
        return array_filter(get_object_vars($this), function ($var) {
49
            return $var !== null;
50
        });
51
    }
52
}
53