Passed
Pull Request — 2.2 (#19879)
by Wilmer
05:27
created

QueryExpressionBuilder   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 18
ccs 0
cts 3
cp 0
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A build() 0 5 1
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