Completed
Push — master ( 75719e...e50beb )
by Olivier
06:30
created

Table::getTableName()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 2.0625

Importance

Changes 0
Metric Value
dl 0
loc 8
ccs 3
cts 4
cp 0.75
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 0
crap 2.0625
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\Exception\NoTableNameDefinedException;
9
10
abstract class Table implements TableInterface
11
{
12
    protected static $tableName;
13
    protected static $order = 50;
14
15
    abstract public function addTableToSchema(Schema $schema);
16
17 3
    public static function getOrder(): int
18
    {
19 3
        return static::$order;
20
    }
21
22 2
    public static function getTableName(): string
23
    {
24 2
        if (null === static::$tableName) {
25
            throw new NoTableNameDefinedException(static::class);
26
        }
27
28 2
        return static::$tableName;
29
    }
30
31 2
    public function getRows(): array
32
    {
33 2
        return [];
34
    }
35
}
36