InsertColumns::build()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 13

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 8
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 13
ccs 8
cts 8
cp 1
rs 9.8333
c 0
b 0
f 0
cc 2
nc 2
nop 0
crap 2
1
<?php
2
declare(strict_types=1);
3
4
namespace Sirius\Sql\Component;
5
6
class InsertColumns extends ModifyColumns
7
{
8 1
    public function build(): string
9
    {
10 1
        $quotedColumns = [];
11 1
        foreach ($this->list as $col => $val) {
12 1
            $quotedColumns[] = $this->quoter->quoteIdentifier($col);
13
        }
14
15
        return '('
16 1
               . $this->indentCsv($quotedColumns)
17 1
               . PHP_EOL . ') VALUES ('
18 1
               . $this->indentCsv(array_values($this->list))
19 1
               . PHP_EOL . ')';
20
    }
21
}
22