Failed Conditions
Push — master ( 746c21...bb3715 )
by Kentaro
35:35
created

Version20160908161616::up()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 12
Code Lines 7

Duplication

Lines 12
Ratio 100 %

Importance

Changes 0
Metric Value
dl 12
loc 12
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 7
nc 2
nop 1
1
<?php
2
3
namespace DoctrineMigrations;
4
5
use Doctrine\DBAL\Migrations\AbstractMigration;
6
use Doctrine\DBAL\Schema\Schema;
7
8
class Version20160908161616 extends AbstractMigration
0 ignored issues
show
introduced by
Missing class doc comment
Loading history...
9
{
10
    /**
11
     * @param Schema $schema
12
     */
13 View Code Duplication
    public function up(Schema $schema)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
14
    {
15
        // DeliveryDate のお届け日数を修正
16
        // see https://github.com/EC-CUBE/ec-cube/issues/1732
17
        $app = \Eccube\Application::getInstance();
18
        $em = $app["orm.em"];
19
        $DeliveryDate = $app['eccube.repository.delivery_date']->find(9);
20
        if ($DeliveryDate->getValue() === 0) {
21
            $DeliveryDate->setValue(-1);
22
            $em->flush($DeliveryDate);
23
        }
24
    }
25
26
    /**
27
     * @param Schema $schema
28
     */
29 View Code Duplication
    public function down(Schema $schema)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
30
    {
31
        $app = \Eccube\Application::getInstance();
32
        $em = $app["orm.em"];
33
        $DeliveryDate = $app['eccube.repository.delivery_date']->find(9);
34
        if ($DeliveryDate->getValue() === -1) {
35
            $DeliveryDate->setValue(0);
36
            $em->flush($DeliveryDate);
37
        }
38
    }
39
}
40