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

Table::getName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 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