Slide   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 30%

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 0
dl 0
loc 24
ccs 3
cts 10
cp 0.3
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A addLine() 0 8 2
A isEmpty() 0 4 1
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