Failed Conditions
Push — master ( 656579...2742cd )
by Marco
11:55
created

TableGeneratorSchemaVisitor   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 59
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 7
dl 0
loc 59
ccs 0
cts 25
cp 0
rs 10
c 0
b 0
f 0

7 Methods

Rating   Name   Duplication   Size   Complexity  
A acceptSchema() 0 6 1
A acceptSequence() 0 2 1
A acceptIndex() 0 2 1
A acceptColumn() 0 2 1
A __construct() 0 3 1
A acceptTable() 0 2 1
A acceptForeignKey() 0 2 1
1
<?php
2
/*
3
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
4
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
5
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
6
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
7
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
11
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
12
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
13
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14
 *
15
 * This software consists of voluntary contributions made by many individuals
16
 * and is licensed under the MIT license. For more information, see
17
 * <http://www.doctrine-project.org>.
18
 */
19
20
namespace Doctrine\DBAL\Id;
21
22
use Doctrine\DBAL\Schema\Table;
23
use Doctrine\DBAL\Schema\Schema;
24
use Doctrine\DBAL\Schema\Column;
25
use Doctrine\DBAL\Schema\ForeignKeyConstraint;
26
use Doctrine\DBAL\Schema\Sequence;
27
use Doctrine\DBAL\Schema\Index;
28
29
class TableGeneratorSchemaVisitor implements \Doctrine\DBAL\Schema\Visitor\Visitor
30
{
31
    /**
32
     * @var string
33
     */
34
    private $generatorTableName;
35
36
    /**
37
     * @param string $generatorTableName
38
     */
39
    public function __construct($generatorTableName = 'sequences')
40
    {
41
        $this->generatorTableName = $generatorTableName;
42
    }
43
44
    /**
45
     * {@inheritdoc}
46
     */
47
    public function acceptSchema(Schema $schema)
48
    {
49
        $table = $schema->createTable($this->generatorTableName);
50
        $table->addColumn('sequence_name', 'string');
51
        $table->addColumn('sequence_value', 'integer', ['default' => 1]);
52
        $table->addColumn('sequence_increment_by', 'integer', ['default' => 1]);
53
    }
54
55
    /**
56
     * {@inheritdoc}
57
     */
58
    public function acceptTable(Table $table)
59
    {
60
    }
61
62
    /**
63
     * {@inheritdoc}
64
     */
65
    public function acceptColumn(Table $table, Column $column)
66
    {
67
    }
68
69
    /**
70
     * {@inheritdoc}
71
     */
72
    public function acceptForeignKey(Table $localTable, ForeignKeyConstraint $fkConstraint)
73
    {
74
    }
75
76
    /**
77
     * {@inheritdoc}
78
     */
79
    public function acceptIndex(Table $table, Index $index)
80
    {
81
    }
82
83
    /**
84
     * {@inheritdoc}
85
     */
86
    public function acceptSequence(Sequence $sequence)
87
    {
88
    }
89
}
90