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

Table   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 87.5%

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 1
dl 0
loc 26
ccs 7
cts 8
cp 0.875
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
addTableToSchema() 0 1 ?
A getOrder() 0 4 1
A getTableName() 0 8 2
A getRows() 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\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