AbstractPluginManager   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 1
c 0
b 0
f 0
lcom 0
cbo 2
dl 0
loc 19
ccs 0
cts 8
cp 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A migrationSchema() 0 14 1
1
<?php
2
3
namespace Eccube\Plugin;
4
5
use Doctrine\DBAL\Migrations\Migration;
6
use Doctrine\DBAL\Migrations\Configuration\Configuration;
7
8
class AbstractPluginManager {
0 ignored issues
show
introduced by
Missing class doc comment
Loading history...
9
10
    CONST MIGRATION_TABLE_PREFIX = 'migration_';
0 ignored issues
show
Coding Style introduced by
As per coding-style, PHP keywords should be in lowercase; expected const, but found CONST.
Loading history...
11
12
    public function migrationSchema($app,$migrationFilePath,$pluginCode,$version=null)
0 ignored issues
show
introduced by
Missing function doc comment
Loading history...
introduced by
Add a single space after each comma delimiter
Loading history...
Coding Style introduced by
Expected 1 space between comma and argument "$migrationFilePath"; 0 found
Loading history...
Coding Style introduced by
Expected 1 space between comma and argument "$pluginCode"; 0 found
Loading history...
Coding Style introduced by
Incorrect spacing between argument "$version" and equals sign; expected 1 but found 0
Loading history...
Coding Style introduced by
Incorrect spacing between default value and equals sign for argument "$version"; expected 1 but found 0
Loading history...
Coding Style introduced by
Expected 1 space between comma and argument "$version"; 0 found
Loading history...
13
    {
14
        $config = new Configuration($app['db']);
15
        $config->setMigrationsNamespace('DoctrineMigrations');
16
        $config->setMigrationsDirectory($migrationFilePath);
17
        $config->registerMigrationsFromDirectory($migrationFilePath );
18
        $config->setMigrationsTableName(self::MIGRATION_TABLE_PREFIX.$pluginCode);
19
        $migration = new Migration($config);
20
                                  // null 又は 'last' を渡すと最新バージョンまでマイグレートする
21
                                  // 0か'first'を渡すと最初に戻る
22
        $migration->migrate($version, false); 
0 ignored issues
show
introduced by
Please trim any trailing whitespace
Loading history...
23
24
25
    }
26
}
27