Passed
Pull Request — main (#435)
by Martin
38:39 queued 23:39
created

ST_Extrude   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 6
c 1
b 0
f 1
dl 0
loc 9
ccs 0
cts 6
cp 0
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A customizeFunction() 0 7 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\PostGIS;
6
7
use MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\BaseFunction;
8
9
/**
10
 * Implementation of PostGIS ST_Extrude() function.
11
 *
12
 * Extrudes a 2D geometry to 3D.
13
 * Useful for creating 3D representations of 2D geometries.
14
 *
15
 * @see https://postgis.net/docs/ST_Extrude.html
16
 * @since 3.5
17
 *
18
 * @author Martin Georgiev <[email protected]>
19
 *
20
 * @example Using it in DQL: "SELECT ST_EXTRUDE(g.geometry, 0, 0, 10) FROM Entity g"
21
 * Returns 3D extruded geometry.
22
 */
23
class ST_Extrude extends BaseFunction
24
{
25
    protected function customizeFunction(): void
26
    {
27
        $this->setFunctionPrototype('ST_Extrude(%s, %s, %s, %s)');
28
        $this->addNodeMapping('StringPrimary');
29
        $this->addNodeMapping('Literal');
30
        $this->addNodeMapping('Literal');
31
        $this->addNodeMapping('Literal');
32
    }
33
}
34