DoctrineMigration   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 27
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
getTableName() 0 1 ?
A up() 0 12 1
A down() 0 4 1
1
<?php
2
3
namespace BWC\Share\Data\Sequence;
4
5
use Doctrine\DBAL\Connection;
6
use Doctrine\DBAL\Migrations\AbstractMigration,
7
    Doctrine\DBAL\Schema\Schema;
8
9
abstract class DoctrineMigration extends AbstractMigration
10
{
11
12
    /**
13
     * @return string
14
     */
15
    abstract function getTableName();
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
16
17
18
    public function up(Schema $schema)
19
    {
20
        $tbl = $this->getTableName();
21
        /** @var $con Connection */
22
        $con = $this->connection;
23
        $con->exec("CREATE TABLE `{$tbl}` (
24
          `name` varchar(20) NOT NULL,
25
          `value` char(32) NOT NULL,
26
          PRIMARY KEY (`name`,`value`)
27
        ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci ");
28
29
    }
30
31
    public function down(Schema $schema)
32
    {
33
34
    }
35
}
36