Passed
Pull Request — main (#236)
by
unknown
02:45
created

SplitPart::customiseFunction()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 4
c 1
b 0
f 1
dl 0
loc 6
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace MartinGeorgiev\Doctrine\ORM\Query\AST\Functions;
6
7
/**
8
 * Implementation of PostgreSql SPLIT_PART().
9
 *
10
 * @see https://www.postgresql.org/docs/15/functions-string.html
11
 *
12
 * @author Sylvain Beissier <[email protected]>
13
 */
14
class SplitPart extends BaseFunction
15
{
16
    protected function customiseFunction(): void
17
    {
18
        $this->setFunctionPrototype('split_part(%s, %s, %s)');
19
        $this->addNodeMapping('StringPrimary');
20
        $this->addNodeMapping('StringPrimary');
21
        $this->addNodeMapping('SimpleArithmeticExpression');
22
    }
23
}
24