Code Duplication    Length = 46-46 lines in 2 locations

src/Commands/Steps/Migrate.php 1 location

@@ 3-48 (lines=46) @@
1
<?php namespace Lanin\Laravel\SetupWizard\Commands\Steps;
2
3
class Migrate extends AbstractStep
4
{
5
    /**
6
     * Return command prompt text.
7
     *
8
     * @return string
9
     */
10
    public function prompt()
11
    {
12
        return 'Run database migrations?';
13
    }
14
15
    /**
16
     * Prepare step data.
17
     *
18
     * @return mixed
19
     */
20
    public function prepare()
21
    {
22
        return null;
23
    }
24
25
    /**
26
     * Preview results.
27
     *
28
     * @param  mixed $results
29
     * @return void
30
     */
31
    public function preview($results)
32
    {
33
        $this->command->info(
34
            'This command will be executed: <comment>php artisan migrate:refresh --force --no-interaction</comment>'
35
        );
36
    }
37
38
    /**
39
     * Finish step.
40
     *
41
     * @param  mixed $results
42
     * @return bool
43
     */
44
    public function finish($results)
45
    {
46
        return ! (bool) \Artisan::call('migrate:refresh', ['--force' => true, '--no-interaction' => true]);
47
    }
48
}

src/Commands/Steps/Optimize.php 1 location

@@ 3-48 (lines=46) @@
1
<?php namespace Lanin\Laravel\SetupWizard\Commands\Steps;
2
3
class Optimize extends AbstractStep
4
{
5
    /**
6
     * Return command prompt text.
7
     *
8
     * @return string
9
     */
10
    public function prompt()
11
    {
12
        return 'Do you want to optimize code?';
13
    }
14
15
    /**
16
     * Prepare step data.
17
     *
18
     * @return mixed
19
     */
20
    public function prepare()
21
    {
22
        return null;
23
    }
24
25
    /**
26
     * Preview results.
27
     *
28
     * @param  mixed $results
29
     * @return void
30
     */
31
    public function preview($results)
32
    {
33
        $this->command->info(
34
            'This command will be executed: <comment>php artisan optimize --force --no-interaction</comment>'
35
        );
36
    }
37
38
    /**
39
     * Finish step.
40
     *
41
     * @param  mixed $results
42
     * @return bool
43
     */
44
    public function finish($results)
45
    {
46
        return ! (bool) \Artisan::call('optimize', ['--force' => true, '--no-interaction' => true]);
47
    }
48
}