Completed
Push — master ( 58092b...0f4ccf )
by Ryan
05:18
created

LoadBaseMigrations   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 35
Duplicated Lines 100 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 4 4 1
A handle() 11 11 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 namespace Anomaly\Streams\Platform\Installer\Console\Command;
2
3
use Anomaly\Streams\Platform\Installer\Installer;
4
use Anomaly\Streams\Platform\Installer\InstallerCollection;
5
use Illuminate\Contracts\Console\Kernel;
6
7
/**
8
 * Class LoadBaseMigrations
9
 *
10
 * @link   http://pyrocms.com/
11
 * @author PyroCMS, Inc. <[email protected]>
12
 * @author Ryan Thompson <[email protected]>
13
 */
14 View Code Duplication
class LoadBaseMigrations
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...
15
{
16
17
    /**
18
     * The installer collection.
19
     *
20
     * @var InstallerCollection
21
     */
22
    protected $installers;
23
24
    /**
25
     * Create a new LoadBaseMigrations instance.
26
     *
27
     * @param InstallerCollection $installers
28
     */
29
    public function __construct(InstallerCollection $installers)
30
    {
31
        $this->installers = $installers;
32
    }
33
34
    /**
35
     * Handle the command.
36
     */
37
    public function handle()
38
    {
39
        $this->installers->add(
40
            new Installer(
41
                'streams::installer.running_migrations',
42
                function (Kernel $console) {
43
                    $console->call('migrate', ['--force' => true]);
44
                }
45
            )
46
        );
47
    }
48
}
49