RunMigrationsSolution   A
last analyzed

Complexity

Total Complexity 8

Size/Duplication

Total Lines 46
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 8
lcom 0
cbo 1
dl 0
loc 46
rs 10
c 0
b 0
f 0

8 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getSolutionTitle() 0 4 1
A getSolutionDescription() 0 4 1
A getDocumentationLinks() 0 6 1
A getRunParameters() 0 4 1
A getSolutionActionDescription() 0 4 1
A getRunButtonText() 0 4 1
A run() 0 4 1
1
<?php
2
3
namespace Facade\Ignition\Solutions;
4
5
use Facade\IgnitionContracts\RunnableSolution;
6
use Illuminate\Support\Facades\Artisan;
7
8
class RunMigrationsSolution implements RunnableSolution
9
{
10
    private $customTitle;
11
12
    public function __construct($customTitle = '')
13
    {
14
        $this->customTitle = $customTitle;
15
    }
16
17
    public function getSolutionTitle(): string
18
    {
19
        return $this->customTitle;
20
    }
21
22
    public function getSolutionDescription(): string
23
    {
24
        return 'You might have forgotten to run your migrations. You can run your migrations using `php artisan migrate`.';
25
    }
26
27
    public function getDocumentationLinks(): array
28
    {
29
        return [
30
            'Database: Running Migrations docs' => 'https://laravel.com/docs/master/migrations#running-migrations',
31
        ];
32
    }
33
34
    public function getRunParameters(): array
35
    {
36
        return [];
37
    }
38
39
    public function getSolutionActionDescription(): string
40
    {
41
        return 'Pressing the button below will try to run your migrations.';
42
    }
43
44
    public function getRunButtonText(): string
45
    {
46
        return 'Run migrations';
47
    }
48
49
    public function run(array $parameters = [])
50
    {
51
        Artisan::call('migrate');
52
    }
53
}
54