Component::indent()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 9
ccs 5
cts 5
cp 1
rs 9.9666
c 0
b 0
f 0
cc 2
nc 2
nop 1
crap 2
1
<?php
2
declare(strict_types=1);
3
4
namespace Sirius\Sql\Component;
5
6
abstract class Component
7
{
8 18
    public function indentCsv(array $list): string
9
    {
10 18
        return PHP_EOL . '    '
11 18
               . implode(',' . PHP_EOL . '    ', $list);
12
    }
13
14 18
    public function indent(array $list): string
15
    {
16 18
        if (empty($list)) {
17 15
            return '';
18
        }
19
20 15
        return PHP_EOL . '    '
21 15
               . implode(PHP_EOL . '    ', $list);
22
    }
23
24
    abstract public function build(): string;
25
}
26