Test Failed
Pull Request — dev (#123)
by Def
06:45 queued 04:20
created

DQLQueryBuilder   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
c 1
b 0
f 0
dl 0
loc 35
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A defaultConditionClasses() 0 7 1
A defaultExpressionBuilders() 0 5 1
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
    protected function defaultConditionClasses(): array
28
    {
29
        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
    protected function defaultExpressionBuilders(): array
48
    {
49
        return array_merge(parent::defaultExpressionBuilders(), [
50
            ArrayExpression::class => ArrayExpressionBuilder::class,
51
            JsonExpression::class => JsonExpressionBuilder::class,
52
        ]);
53
    }
54
}
55