CreateTokenCollectionCollection::__construct()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 4
cts 4
cp 1
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 3
nc 2
nop 1
crap 2
1
<?php
2
3
namespace Hgraca\MicroDbal\Crud\QueryBuilder\Sql;
4
5
final class CreateTokenCollectionCollection
6
{
7
    /** @var CreateTokenCollection[] */
8
    private $collection;
9
10 5
    public function __construct(array $dataSetList)
11
    {
12 5
        foreach ($dataSetList as $dataSet) {
13 5
            $this->collection[] = new CreateTokenCollection($dataSet);
14
        };
15 5
    }
16
17 3
    public function getColumnList(): string
18
    {
19 3
        $createTokenCollection = reset($this->collection);
20
21 3
        return $createTokenCollection->getColumnList();
22
    }
23
24 3
    public function getPlaceholderList(): string
25
    {
26 3
        $createTokenCollection = reset($this->collection);
27
28 3
        return $createTokenCollection->getPlaceholderList();
29
    }
30
31 3
    public function getBindingsList(): array
32
    {
33 3
        $bindingsList = [];
34
35 3
        foreach ($this->collection as $createTokenCollection) {
36 3
            $bindingsList[] = $createTokenCollection->getBindingsList();
37
        }
38
39 3
        return $bindingsList;
40
    }
41
}
42