Completed
Push — master ( be0721...cced22 )
by Matthew
02:48
created

Version20170623203059   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 2
c 1
b 0
f 1
lcom 0
cbo 3
dl 23
loc 23
rs 10

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

1
<?php
2
3
namespace Application\Migrations;
4
5
use Doctrine\DBAL\Migrations\AbstractMigration;
6
use Doctrine\DBAL\Schema\Schema;
7
8
/**
9
 * Auto-generated Migration: Please modify to your needs!
10
 */
11
class Version20170623203059 extends AbstractMigration
12
{
13
    /**
14
     * @param Schema $schema
15
     */
16
    public function up(Schema $schema)
17
    {
18
        $table = $schema->createTable('usage_timeline');
19
        $table->addColumn('id', 'integer', ['autoincrement' => true]);
20
        $table->addColumn('date', 'date');
21
        $table->addColumn('tool', 'string');
22
        $table->addColumn('count', 'integer');
23
        $table->setPrimaryKey(['id']);
24
    }
25
26
    /**
27
     * @param Schema $schema
28
     */
29
    public function down(Schema $schema)
30
    {
31
        $schema->dropTable('usage_timeline');
32
    }
33
}
34