Completed
Pull Request — master (#193)
by Ryan
17:05 queued 09:54
created

LoadApplicationInstallers::handle()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 18
Code Lines 10

Duplication

Lines 18
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 18
loc 18
rs 9.4285
cc 1
eloc 10
nc 1
nop 0
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 App\Console\Kernel;
6
use Illuminate\Contracts\Bus\SelfHandling;
7
8
/**
9
 * Class LoadApplicationInstallers
10
 *
11
 * @link          http://anomaly.is/streams-platform
12
 * @author        AnomalyLabs, Inc. <[email protected]>
13
 * @author        Ryan Thompson <[email protected]>
14
 * @package       Anomaly\Streams\Platform\Installer\Console\Command
15
 */
16 View Code Duplication
class LoadApplicationInstallers implements SelfHandling
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...
17
{
18
19
    /**
20
     * The installer collection.
21
     *
22
     * @var InstallerCollection
23
     */
24
    protected $installers;
25
26
    /**
27
     * Create a new LoadApplicationInstallers instance.
28
     *
29
     * @param InstallerCollection $installers
30
     */
31
    public function __construct(InstallerCollection $installers)
32
    {
33
        $this->installers = $installers;
34
    }
35
36
    /**
37
     * Handle the command.
38
     */
39
    public function handle()
40
    {
41
        $this->installers->add(
42
            new Installer(
43
                'streams::installer.running_application_migrations',
44
                function (Kernel $console) {
45
                    $console->call(
46
                        'migrate',
47
                        [
48
                            '--force'     => true,
49
                            '--no-addons' => true,
50
                            '--path'      => 'vendor/anomaly/streams-platform/migrations/application'
51
                        ]
52
                    );
53
                }
54
            )
55
        );
56
    }
57
}
58