Completed
Push — master ( b28f87...a255d6 )
by Olivier
03:32
created

Table   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 91.67%

Importance

Changes 0
Metric Value
wmc 6
lcom 1
cbo 2
dl 0
loc 35
ccs 11
cts 12
cp 0.9167
rs 10
c 0
b 0
f 0

6 Methods

Rating   Name   Duplication   Size   Complexity  
addTableToSchema() 0 1 ?
A getTableName() 0 8 2
A getRows() 0 4 1
A getTypes() 0 4 1
A getProcessor() 0 4 1
A getName() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Shapin\Datagen\DBAL;
6
7
use Doctrine\DBAL\Schema\Schema;
8
use Shapin\Datagen\Fixture;
9
use Shapin\Datagen\DBAL\Exception\NoTableNameDefinedException;
10
11
abstract class Table extends Fixture implements TableInterface
12
{
13
    protected static $tableName;
14
15
    abstract public function addTableToSchema(Schema $schema);
16
17 10
    public static function getTableName(): string
18
    {
19 10
        if (null === static::$tableName) {
20
            throw new NoTableNameDefinedException(static::class);
21
        }
22
23 10
        return static::$tableName;
24
    }
25
26 2
    public function getRows(): iterable
27
    {
28 2
        return [];
29
    }
30
31 2
    public function getTypes(): array
32
    {
33 2
        return [];
34
    }
35
36 7
    public function getProcessor(): string
37
    {
38 7
        return 'dbal';
39
    }
40
41 7
    public function getName(): string
42
    {
43 7
        return self::getTableName();
44
    }
45
}
46