Completed
Pull Request — master (#8105)
by
unknown
10:29
created

AvgFunction::getSql()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
ccs 0
cts 3
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Doctrine\ORM\Query\AST\Functions;
6
7
use Doctrine\ORM\Query\AST\AggregateExpression;
8
use Doctrine\ORM\Query\Parser;
9
use Doctrine\ORM\Query\SqlWalker;
10
11
/**
12
 * "AVG" "(" ["DISTINCT"] StringPrimary ")"
13
 */
14
final class AvgFunction extends FunctionNode
15
{
16
    /** @var AggregateExpression */
17
    private $aggregateExpression;
18
19
    /**
20
     * @inheritDoc
21
     */
22
    public function getSql(SqlWalker $sqlWalker) : string
23
    {
24
        return $this->aggregateExpression->dispatch($sqlWalker);
25
    }
26
27
    /**
28
     * @inheritDoc
29
     */
30
    public function parse(Parser $parser) : void
31
    {
32
        $this->aggregateExpression = $parser->AggregateExpression();
33
    }
34
}
35