Passed
Pull Request — master (#38)
by Teye
05:43
created

HdfsInputSource   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
eloc 6
c 0
b 0
f 0
dl 0
loc 30
ccs 5
cts 5
cp 1
rs 10

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\InputSources;
5
6
class HdfsInputSource implements InputSourceInterface
7
{
8
    /**
9
     * HDFS paths. Can be either a JSON array or comma-separated string of paths. Wildcards like * are supported in
10
     * these paths. Empty files located under one of the given paths will be skipped.
11
     *
12
     * @var string[]|string
13
     */
14
    protected $paths;
15
16
    /**
17
     * HdfsInputSource constructor.
18
     *
19
     * @param string[]|string $paths HDFS paths. Can be either a JSON array or comma-separated string of paths. Wildcards
20
     *                               like * are supported in these paths. Empty files located under one of the given paths
21
     *                               will be skipped.
22
     */
23 1
    public function __construct($paths)
24
    {
25 1
        $this->paths = $paths;
26
    }
27
28
    /**
29
     * @return array<string,string|string[]>
30
     */
31 1
    public function toArray(): array
32
    {
33
        return [
34 1
            'type'  => 'hdfs',
35 1
            'paths' => $this->paths,
36
        ];
37
    }
38
}