Passed
Pull Request — master (#380)
by Wilmer
04:10 queued 01:20
created

Schema   A

Complexity

Total Complexity 14

Size/Duplication

Total Lines 70
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 15
c 1
b 0
f 0
dl 0
loc 70
rs 10
wmc 14

14 Methods

Rating   Name   Duplication   Size   Complexity  
A loadTableSchema() 0 3 1
A loadTableUniques() 0 3 1
A loadTableChecks() 0 3 1
A getLastInsertID() 0 3 1
A loadTableIndexes() 0 3 1
A loadTableDefaultValues() 0 3 1
A loadTableForeignKeys() 0 3 1
A supportsSavepoint() 0 3 1
A loadTablePrimaryKey() 0 3 1
A __construct() 0 3 1
A createColumnSchemaBuilder() 0 3 1
A getCacheKey() 0 3 1
A findUniqueIndexes() 0 3 1
A getCacheTag() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Db\Tests\Support\Stubs;
6
7
use Yiisoft\Db\Cache\SchemaCache;
8
use Yiisoft\Db\Connection\ConnectionInterface;
9
use Yiisoft\Db\Constraint\Constraint;
10
use Yiisoft\Db\Schema\ColumnSchemaBuilder;
11
use Yiisoft\Db\Schema\SchemaInterface;
12
use Yiisoft\Db\Schema\TableSchemaInterface;
13
14
final class Schema extends \Yiisoft\Db\Schema\Schema implements SchemaInterface
15
{
16
    public function __construct(ConnectionInterface $connection, SchemaCache $schemaCache)
17
    {
18
        parent::__construct($connection, $schemaCache);
19
    }
20
21
    public function createColumnSchemaBuilder(string $type, array|int|string $length = null): ColumnSchemaBuilder
22
    {
23
        return new ColumnSchemaBuilder($type, $length);
24
    }
25
26
    public function findUniqueIndexes(TableSchemaInterface $table): array
27
    {
28
        return [];
29
    }
30
31
    public function getLastInsertID(string $sequenceName = null): string
32
    {
33
        return '';
34
    }
35
36
    protected function getCacheKey(string $name): array
37
    {
38
        return [];
39
    }
40
41
    protected function getCacheTag(): string
42
    {
43
        return '';
44
    }
45
46
    protected function loadTableChecks(string $tableName): array
47
    {
48
        return [];
49
    }
50
51
    protected function loadTableDefaultValues(string $tableName): array
52
    {
53
        return [];
54
    }
55
56
    protected function loadTableForeignKeys(string $tableName): array
57
    {
58
        return [];
59
    }
60
61
    protected function loadTableIndexes(string $tableName): array
62
    {
63
        return [];
64
    }
65
66
    protected function loadTablePrimaryKey(string $tableName): Constraint|null
67
    {
68
        return [];
0 ignored issues
show
Bug Best Practice introduced by
The expression return array() returns the type array which is incompatible with the type-hinted return Yiisoft\Db\Constraint\Constraint|null.
Loading history...
69
    }
70
71
    protected function loadTableUniques(string $tableName): array
72
    {
73
        return [];
74
    }
75
76
    protected function loadTableSchema(string $name): TableSchemaInterface|null
77
    {
78
        return null;
79
    }
80
81
    public function supportsSavepoint(): bool
82
    {
83
        return false;
84
    }
85
}
86