Passed
Push — dev ( cc6591...c9f34d )
by Wilmer
04:23 queued 23s
created

TableSchema::catalogName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Db\Mssql;
6
7
use Yiisoft\Db\Schema\TableSchema as AbstractTableSchema;
8
9
/**
10
 * TableSchema represents the metadata of a database table.
11
 */
12
final class TableSchema extends AbstractTableSchema
13
{
14
    private ?string $catalogName = null;
15
    private array $foreignKeys = [];
16
17
    /**
18
     * @param string|null name of the catalog (database) that this table belongs to. Defaults to null, meaning no
0 ignored issues
show
Bug introduced by
The type Yiisoft\Db\Mssql\name 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...
19
     * catalog (or the current database).
20
     */
21
    public function catalogName(?string $value): void
22
    {
23
        $this->catalogName = $value;
24
    }
25
26 103
    public function getCatalogName(): ?string
27
    {
28 103
        return $this->catalogName;
29
    }
30
31
    /**
32
     * @return array foreign keys of this table. Each array element is of the following structure:
33
     *
34
     * ```php
35
     * [
36
     *  'ForeignTableName',
37
     *  'fk1' => 'pk1',  // pk1 is in foreign table
38
     *  'fk2' => 'pk2',  // if composite foreign key
39
     * ]
40
     * ```
41
     */
42 5
    public function getForeignKeys(): array
43
    {
44 5
        return $this->foreignKeys;
45
    }
46
47 94
    public function foreignKeys(array $value): void
48
    {
49 94
        $this->foreignKeys = $value;
50
    }
51
}
52