Component::indentCsv()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 5
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 1
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