Completed
Push — master ( 9271e2...253fe0 )
by Maxim
04:13
created

Migrate::prompt()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 4
Ratio 100 %

Code Coverage

Tests 2
CRAP Score 1

Importance

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