ReturnColumns   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 1
dl 0
loc 21
ccs 9
cts 9
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A add() 0 7 2
A build() 0 8 2
1
<?php
2
declare(strict_types=1);
3
4
namespace Sirius\Sql\Component;
5
6
class ReturnColumns extends Component
7
{
8
    protected $list = [];
9
10 1
    public function add(string $expr, string ...$exprs): void
11
    {
12 1
        $this->list[] = $expr;
13 1
        foreach ($exprs as $expr) {
14 1
            $this->list[] = $expr;
15
        }
16 1
    }
17
18 3
    public function build(): string
19
    {
20 3
        if (empty($this->list)) {
21 2
            return '';
22
        }
23
24 1
        return PHP_EOL . 'RETURNING' . $this->indentCsv($this->list);
25
    }
26
}
27