Test Failed
Pull Request — master (#44)
by Wilmer
13:17 queued 09:47
created

DDLQueryBuilder   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 8
dl 0
loc 19
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A dropCommentFromTable() 0 3 1
A dropCommentFromColumn() 0 7 1
A __construct() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Db\Oracle;
6
7
use Yiisoft\Db\Query\DDLQueryBuilder as AbstractDDLQueryBuilder;
0 ignored issues
show
Bug introduced by
The type Yiisoft\Db\Query\DDLQueryBuilder 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...
8
use Yiisoft\Db\Query\QueryBuilderInterface;
0 ignored issues
show
Bug introduced by
The type Yiisoft\Db\Query\QueryBuilderInterface 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...
9
10
final class DDLQueryBuilder extends AbstractDDLQueryBuilder
11
{
12
    public function __construct(private QueryBuilderInterface $queryBuilder)
13
    {
14
        parent::__construct($queryBuilder);
15
    }
16
17
    public function dropCommentFromColumn(string $table, string $column): string
18
    {
19
        return 'COMMENT ON COLUMN '
20
            . $this->queryBuilder->quoter()->quoteTableName($table)
21
            . '.'
22
            . $this->queryBuilder->quoter()->quoteColumnName($column)
23
            . " IS ''";
24
    }
25
26
    public function dropCommentFromTable(string $table): string
27
    {
28
        return 'COMMENT ON TABLE ' . $this->queryBuilder->quoter()->quoteTableName($table) . " IS ''";
29
    }
30
}
31