TableDataSource   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 6
dl 0
loc 19
ccs 6
cts 6
cp 1
rs 10
c 1
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A toArray() 0 5 1
1
<?php
2
declare(strict_types=1);
3
4
namespace Level23\Druid\DataSources;
5
6
class TableDataSource implements DataSourceInterface
7
{
8
    public string $dataSourceName;
9
10 353
    public function __construct(string $dataSourceName)
11
    {
12 353
        $this->dataSourceName = $dataSourceName;
13
    }
14
15
    /**
16
     * Return the TableDataSource so that it can be used in a druid query.
17
     *
18
     * @return array<string,string>
19
     */
20 17
    public function toArray(): array
21
    {
22 17
        return [
23 17
            'type' => 'table',
24 17
            'name' => $this->dataSourceName,
25 17
        ];
26
    }
27
}