Passed
Push — 2.2 ( b9e5a8...2e37b5 )
by Alexander
06:27
created

QueryExpressionBuilder::build()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 2
dl 0
loc 5
ccs 0
cts 3
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * @link https://www.yiiframework.com/
4
 * @copyright Copyright (c) 2008 Yii Software LLC
5
 * @license https://www.yiiframework.com/license/
6
 */
7
8
namespace yii\db;
9
10
/**
11
 * Class QueryExpressionBuilder is used internally to build [[Query]] object
12
 * using unified [[QueryBuilder]] expression building interface.
13
 *
14
 * @author Dmytro Naumenko <[email protected]>
15
 * @since 2.0.14
16
 */
17
class QueryExpressionBuilder implements ExpressionBuilderInterface
18
{
19
    use ExpressionBuilderTrait;
20
21
22
    /**
23
     * Method builds the raw SQL from the $expression that will not be additionally
24
     * escaped or quoted.
25
     *
26
     * @param ExpressionInterface|Query $expression the expression to be built.
27
     * @param array $params the binding parameters.
28
     * @return string the raw SQL that will not be additionally escaped or quoted.
29
     */
30
    public function build(ExpressionInterface $expression, array &$params = [])
31
    {
32
        list($sql, $params) = $this->queryBuilder->build($expression, $params);
33
34
        return "($sql)";
35
    }
36
}
37