Slide::addLine()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
dl 0
loc 8
ccs 0
cts 5
cp 0
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 5
nc 2
nop 1
crap 6
1
<?php declare(strict_types=1);
2
3
namespace Bigwhoop\Trumpet\Config;
4
5
final class Slide
6
{
7
    /** @var string */
8
    public $content = '';
9
10 2
    public function __construct(string $content = '')
11
    {
12 2
        $this->content = $content;
13 2
    }
14
15
    public function addLine(string $content)
16
    {
17
        if (empty($this->content)) {
18
            $this->content = $content;
19
        } else {
20
            $this->content .= "\n$content";
21
        }
22
    }
23
24
    public function isEmpty(): bool
25
    {
26
        return $this->content === '';
27
    }
28
}
29