Passed
Push — dev ( 65e869...962df0 )
by Def
08:15 queued 05:32
created

DQLQueryBuilder::defaultExpressionBuilders()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 5
ccs 2
cts 2
cp 1
crap 1
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Db\Pgsql;
6
7
use Yiisoft\Db\Expression\ArrayExpression;
8
use Yiisoft\Db\Expression\ExpressionBuilderInterface;
9
use Yiisoft\Db\Expression\JsonExpression;
10
use Yiisoft\Db\Pgsql\Builder\ArrayExpressionBuilder;
11
use Yiisoft\Db\Pgsql\Builder\JsonExpressionBuilder;
12
use Yiisoft\Db\Query\Conditions\LikeCondition;
0 ignored issues
show
Bug introduced by
The type Yiisoft\Db\Query\Conditions\LikeCondition was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
13
use Yiisoft\Db\Query\DQLQueryBuilder as AbstractDQLQueryBuilder;
0 ignored issues
show
Bug introduced by
The type Yiisoft\Db\Query\DQLQueryBuilder was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
14
15
use function array_merge;
16
17
final class DQLQueryBuilder extends AbstractDQLQueryBuilder
18
{
19
    /**
20
     * Contains array of default condition classes. Extend this method, if you want to change default condition classes
21
     * for the query builder.
22
     *
23
     * @return array
24
     *
25
     * See {@see conditionClasses} docs for details.
26
     */
27 414
    protected function defaultConditionClasses(): array
28
    {
29 414
        return array_merge(parent::defaultConditionClasses(), [
30
            'ILIKE' => LikeCondition::class,
31
            'NOT ILIKE' => LikeCondition::class,
32
            'OR ILIKE' => LikeCondition::class,
33
            'OR NOT ILIKE' => LikeCondition::class,
34
        ]);
35
    }
36
37
    /**
38
     * Contains array of default expression builders. Extend this method and override it, if you want to change default
39
     * expression builders for this query builder.
40
     *
41
     * @return array
42
     *
43
     * See {@see ExpressionBuilder} docs for details.
44
     *
45
     * @psalm-return array<string, class-string<ExpressionBuilderInterface>>
46
     */
47 414
    protected function defaultExpressionBuilders(): array
48
    {
49 414
        return array_merge(parent::defaultExpressionBuilders(), [
50
            ArrayExpression::class => ArrayExpressionBuilder::class,
51
            JsonExpression::class => JsonExpressionBuilder::class,
52
        ]);
53
    }
54
}
55