InsertColumns   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 2
dl 0
loc 16
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A build() 0 13 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