Completed
Push — master ( 4bfa8e...188c75 )
by KwangSeob
21s queued 11s
created

CommentV3::setBody()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 1
Metric Value
cc 1
eloc 1
c 2
b 0
f 1
nc 1
nop 1
dl 0
loc 3
rs 10
1
<?php
2
3
namespace JiraRestApi\Issue;
4
5
class CommentV3 extends Comment
6
{
7
    /** @var \JiraRestApi\Issue\DescriptionV3|null */
8
    public $body;
9
10
    public function setBody($body)
11
    {
12
        return $this->addCommentParagraph($body);
13
    }
14
    
15
    /**
16
     * @param \JiraRestApi\Issue\DescriptionV3|null $description
17
     *
18
     * @return $this
19
     */
20
    public function addCommentParagraph($description)
21
    {
22
        if (empty($this->body)) {
23
            $this->body = new DescriptionV3();
24
        }
25
        
26
        $this->body->addDescriptionContent('paragraph', $description);
27
28
        return $this;
29
    }
30
}
31