NullFilter::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
cc 1
nc 1
nop 1
crap 1
1
<?php
2
declare(strict_types=1);
3
4
namespace Level23\Druid\Filters;
5
6
/**
7
 * Class NullFilter
8
 *
9
 * @see     https://druid.apache.org/docs/latest/querying/filters#null-filter
10
 * @package Level23\Druid\Filters
11
 */
12
class NullFilter implements FilterInterface
13
{
14
    protected string $column;
15
16
    /**
17
     * NullFilter constructor.
18
     *
19
     * @param string $column Input column or virtual column name to filter.
20
     */
21 1
    public function __construct(string $column)
22
    {
23 1
        $this->column = $column;
24
    }
25
26
    /**
27
     * Return the filter as it can be used in the druid query.
28
     *
29
     * @return array<string,string|array<string,string|int|bool|array<mixed>>>
30
     */
31 1
    public function toArray(): array
32
    {
33 1
        return [
34 1
            'type'   => 'null',
35 1
            'column' => $this->column,
36 1
        ];
37
    }
38
}