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

CommentV3::addCommentParagraph()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 4
c 1
b 0
f 0
nc 2
nop 1
dl 0
loc 9
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