Code Duplication    Length = 35-41 lines in 4 locations

src/Installer/Console/Command/LoadApplicationInstallers.php 1 location

@@ 14-54 (lines=41) @@
11
 * @author PyroCMS, Inc. <[email protected]>
12
 * @author Ryan Thompson <[email protected]>
13
 */
14
class LoadApplicationInstallers
15
{
16
17
    /**
18
     * The installer collection.
19
     *
20
     * @var InstallerCollection
21
     */
22
    protected $installers;
23
24
    /**
25
     * Create a new LoadApplicationInstallers 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_application_migrations',
42
                function (Kernel $console) {
43
                    $console->call(
44
                        'migrate',
45
                        [
46
                            '--force' => true,
47
                            '--path'  => 'vendor/anomaly/streams-platform/migrations/application',
48
                        ]
49
                    );
50
                }
51
            )
52
        );
53
    }
54
}
55

src/Installer/Console/Command/LoadCoreInstallers.php 1 location

@@ 7-47 (lines=41) @@
4
use Anomaly\Streams\Platform\Installer\InstallerCollection;
5
use Illuminate\Contracts\Console\Kernel;
6
7
class LoadCoreInstallers
8
{
9
10
    /**
11
     * The installer collection.
12
     *
13
     * @var InstallerCollection
14
     */
15
    protected $installers;
16
17
    /**
18
     * Create a new LoadCoreInstallers instance.
19
     *
20
     * @param InstallerCollection $installers
21
     */
22
    public function __construct(InstallerCollection $installers)
23
    {
24
        $this->installers = $installers;
25
    }
26
27
    /**
28
     * Handle the command.
29
     */
30
    public function handle()
31
    {
32
        $this->installers->add(
33
            new Installer(
34
                'streams::installer.running_core_migrations',
35
                function (Kernel $console) {
36
                    $console->call(
37
                        'migrate',
38
                        [
39
                            '--force' => true,
40
                            '--path'  => 'vendor/anomaly/streams-platform/migrations/core',
41
                        ]
42
                    );
43
                }
44
            )
45
        );
46
    }
47
}
48

src/Installer/Console/Command/LoadBaseMigrations.php 1 location

@@ 14-48 (lines=35) @@
11
 * @author PyroCMS, Inc. <[email protected]>
12
 * @author Ryan Thompson <[email protected]>
13
 */
14
class LoadBaseMigrations
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

src/Installer/Console/Command/LoadBaseSeeders.php 1 location

@@ 14-48 (lines=35) @@
11
 * @author PyroCMS, Inc. <[email protected]>
12
 * @author Ryan Thompson <[email protected]>
13
 */
14
class LoadBaseSeeders
15
{
16
17
    /**
18
     * The installer collection.
19
     *
20
     * @var InstallerCollection
21
     */
22
    protected $installers;
23
24
    /**
25
     * Create a new LoadBaseSeeders 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_seeds',
42
                function (Kernel $console) {
43
                    $console->call('db:seed', ['--force' => true]);
44
                }
45
            )
46
        );
47
    }
48
}
49