Completed
Push — master ( c7f57e...d77439 )
by Rafał
09:30
created

Version20210323112900   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 100 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A up() 6 6 1
A down() 6 6 1

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 declare(strict_types=1);
2
3
namespace SWP\Migrations;
4
5
use Doctrine\DBAL\Schema\Schema;
6
use Doctrine\Migrations\AbstractMigration;
7
8 View Code Duplication
final class Version20210323112900 extends AbstractMigration
9
{
10
    public function up(Schema $schema) : void
11
    {
12
        $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');
13
14
        $this->addSql('ALTER TABLE swp_tenant ADD pwa_config_url VARCHAR(255) DEFAULT NULL');
15
    }
16
17
    public function down(Schema $schema) : void
18
    {
19
        $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');
20
21
        $this->addSql('ALTER TABLE swp_tenant DROP pwa_config_url');
22
    }
23
}
24