Failed Conditions
Push — master ( 660616...b19e2b )
by Kentaro
48:07
created

Version20170225120000   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 35
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A up() 20 20 1
A down() 4 4 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
2
3
namespace DoctrineMigrations;
4
5
use Doctrine\DBAL\Migrations\AbstractMigration;
6
use Doctrine\DBAL\Schema\Schema;
7
use Doctrine\ORM\EntityManager;
8
use Eccube\Entity\PageLayout;
9
10 View Code Duplication
class Version20170225120000 extends AbstractMigration
0 ignored issues
show
Duplication introduced by
This class 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...
introduced by
Missing class doc comment
Loading history...
11
{
12
13
    /**
14
     * @param Schema $schema
15
     */
16
    public function up(Schema $schema)
17
    {
18
        $app = \Eccube\Application::getInstance();
19
        /** @var EntityManager $em */
20
        $em = $app["orm.em"];
21
22
        $DeviceType = $app['eccube.repository.master.device_type']->find(10);
23
24
        $PageLayout = new PageLayout();
25
        $PageLayout
26
            ->setDeviceType($DeviceType)
27
            ->setName('商品購入/確認')
28
            ->setUrl('shopping_confirm')
29
            ->setFileName('Shopping/confirm')
30
            ->setEditFlg(2)
31
            ->setMetaRobots('noindex');
32
        $em->persist($PageLayout);
33
34
        $em->flush();
35
    }
36
37
    /**
38
     * @param Schema $schema
39
     */
40
    public function down(Schema $schema)
41
    {
42
43
    }
44
}
45