Passed
Push — master ( 61038f...7b7d2d )
by Alexander
37:29 queued 30:36
created

BootstrapMigrations   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A appendMigrations() 0 11 2
1
<?php
2
3
namespace Horat1us\Yii\Traits;
4
5
use yii\console;
6
7
/**
8
 * Trait BootstrapMigrations
9
 * @package Horat1us\Yii\Traits
10
 */
11
trait BootstrapMigrations
12
{
13
    protected function appendMigrations(
14
        console\Application $application,
15
        string $migrationNamespace
16
    ): void {
17
        if (!array_key_exists('migrate', $application->controllerMap)) {
18
            $application->controllerMap['migrate'] = [
19
                'class' => console\controllers\MigrateController::class,
20
            ];
21
        }
22
        $application->controllerMap['migrate']['migrationNamespaces'][] = $migrationNamespace;
23
    }
24
}
25