MigrationFactory   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A resolve() 0 12 2
1
<?php
2
3
namespace GinoPane\BlogTaxonomy\Classes\MigrationCommand;
4
5
use GinoPane\BlogTaxonomy\Classes\MigrationCommand\Exceptions\NoPluginException;
6
use GinoPane\BlogTaxonomy\Classes\MigrationCommand\Migrations\NullMigration;
7
use GinoPane\BlogTaxonomy\Classes\MigrationCommand\Migrations\PkleindienstBlogSeriesMigration;
8
use Illuminate\Console\Command;
9
10
/**
11
 * Class MigrationFactory
12
 *
13
 * @package GinoPane\BlogTaxonomy\Classes\MigrationCommand
14
 */
15
class MigrationFactory
0 ignored issues
show
Coding Style introduced by
MigrationFactory does not seem to conform to the naming convention (Utils?$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

Loading history...
16
{
17
    /**
18
     * @param string $plugin
19
     *
20
     * @throws NoPluginException
21
     *
22
     * @return MigrationInterface
23
     */
24
    public static function resolve(string $plugin, Command $command): MigrationInterface
25
    {
26
        $plugin = strtolower($plugin);
0 ignored issues
show
Coding Style introduced by
Consider using a different name than the parameter $plugin. This often makes code more readable.
Loading history...
27
        $migration = new NullMigration($command);
28
29
        switch ($plugin) {
30
            case strtolower(PkleindienstBlogSeriesMigration::PLUGIN_NAME):
31
                $migration = new PkleindienstBlogSeriesMigration($command);
32
        }
33
34
        return $migration;
35
    }
36
}