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

AvgFunction   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 4
c 0
b 0
f 0
dl 0
loc 19
ccs 0
cts 7
cp 0
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A parse() 0 3 1
A getSql() 0 3 1
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