Passed
Pull Request — master (#6709)
by Sergey
12:37
created

NewObjectExpression   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 28
rs 10
c 0
b 0
f 0
ccs 6
cts 6
cp 1
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A dispatch() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Doctrine\ORM\Query\AST;
6
7
/**
8
 * NewObjectExpression ::= "NEW" IdentificationVariable "(" NewObjectArg {"," NewObjectArg}* ")"
9
 */
10
class NewObjectExpression extends Node
11
{
12
    /**
13
     * @var string
14
     */
15
    public $className;
16
17
    /**
18
     * @var mixed[]
19
     */
20
    public $args;
21
22
    /**
23
     * @param string  $className
24
     * @param mixed[] $args
25
     */
26 27
    public function __construct($className, array $args)
27
    {
28 27
        $this->className = $className;
29 27
        $this->args      = $args;
30 27
    }
31
32
    /**
33
     * {@inheritdoc}
34
     */
35 1
    public function dispatch($sqlWalker)
36
    {
37 1
        return $sqlWalker->walkNewObject($this);
38
    }
39
}
40