Passed
Push — pg18-new-features ( 667e5f )
by Martin
14:43
created

JsonbStripNulls::getMaxArgumentCount()   A

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 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace MartinGeorgiev\Doctrine\ORM\Query\AST\Functions;
6
7
/**
8
 * Implementation of PostgreSQL JSONB_STRIP_NULLS().
9
 *
10
 * Supports optional second parameter (PostgreSQL 18+) to control null stripping from arrays.
11
 *
12
 * @see https://www.postgresql.org/docs/18/functions-json.html
13
 * @since 0.10
14
 *
15
 * @author Martin Georgiev <[email protected]>
16
 */
17
class JsonbStripNulls extends BaseVariadicFunction
18
{
19 1
    protected function getFunctionName(): string
20
    {
21 1
        return 'jsonb_strip_nulls';
22
    }
23
24 1
    protected function getNodeMappingPattern(): array
25
    {
26 1
        return [
27 1
            'StringPrimary',
28 1
        ];
29
    }
30
31 1
    protected function getMinArgumentCount(): int
32
    {
33 1
        return 1;
34
    }
35
36 1
    protected function getMaxArgumentCount(): int
37
    {
38 1
        return 2;
39
    }
40
}
41