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

SplitPart   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 8
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 1
eloc 5
c 1
b 0
f 1
dl 0
loc 8
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A customiseFunction() 0 6 1
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