Test Failed
Push — renovate/composer-qa-tooling ( c9a29e )
by
unknown
26:42 queued 11:46
created

Distance   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 7
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A customizeFunction() 0 5 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace MartinGeorgiev\Doctrine\ORM\Query\AST\Functions;
6
7
/**
8
 * Implementation of PostgreSQL's distance operator (using `<@>`).
9
 *
10
 * @see https://www.postgresql.org/docs/17/earthdistance.html#EARTHDISTANCE-POINT-BASED
11
 * @since 3.1
12
 *
13
 * @author Sébastien Jean <[email protected]>
14
 */
15
class Distance extends BaseFunction
16
{
17
    protected function customizeFunction(): void
18
    {
19
        $this->setFunctionPrototype('(%s <@> %s)');
20
        $this->addNodeMapping('StringPrimary');
21
        $this->addNodeMapping('StringPrimary');
22
    }
23
}
24