Passed
Pull Request — master (#3070)
by Sergei
07:45
created

TableGeneratorSchemaVisitor::acceptColumn()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 0

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 1.125

Importance

Changes 0
Metric Value
dl 0
loc 2
ccs 1
cts 2
cp 0.5
rs 10
c 0
b 0
f 0
cc 1
eloc 0
nc 1
nop 2
crap 1.125
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Doctrine\DBAL\Id;
6
7
use Doctrine\DBAL\Schema\Column;
8
use Doctrine\DBAL\Schema\ForeignKeyConstraint;
9
use Doctrine\DBAL\Schema\Index;
10
use Doctrine\DBAL\Schema\Schema;
11
use Doctrine\DBAL\Schema\Sequence;
12
use Doctrine\DBAL\Schema\Table;
13
use Doctrine\DBAL\Schema\Visitor\Visitor;
14
15
final class TableGeneratorSchemaVisitor implements Visitor
16
{
17
    /** @var string */
18
    private $generatorTableName;
19
20 52
    public function __construct(string $generatorTableName = 'sequences')
21
    {
22 52
        $this->generatorTableName = $generatorTableName;
23 52
    }
24
25 52
    public function acceptSchema(Schema $schema) : void
26
    {
27 52
        $table = $schema->createTable($this->generatorTableName);
28
29 52
        $table->addColumn('sequence_name', 'string', ['length' => 255]);
30 52
        $table->addColumn('sequence_value', 'integer', ['default' => 1]);
31 52
        $table->addColumn('sequence_increment_by', 'integer', ['default' => 1]);
32 52
    }
33
34 52
    public function acceptTable(Table $table) : void
35
    {
36 52
    }
37
38 52
    public function acceptColumn(Table $table, Column $column) : void
39
    {
40 52
    }
41
42
    public function acceptForeignKey(Table $localTable, ForeignKeyConstraint $fkConstraint) : void
43
    {
44
    }
45
46
    public function acceptIndex(Table $table, Index $index) : void
47
    {
48
    }
49
50
    public function acceptSequence(Sequence $sequence) : void
51
    {
52
    }
53
}
54