CreateMigrationCommand   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 9
dl 0
loc 29
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A handle() 0 6 1
A __construct() 0 4 1
1
<?php
2
3
4
namespace Quantick\DeployMigration\Commands;
5
6
7
use Quantick\DeployMigration\Lib\Service\MigrationCreator;
8
9
class CreateMigrationCommand extends BaseDeployMigrationCommand
10
{
11
    protected $signature = 'make:deploy-migration';
12
13
    protected $description = 'Create deploy migration';
14
    /**
15
     * @var MigrationCreator
16
     */
17
    private $creator;
18
19
    /**
20
     * DeployMigrateCommand constructor.
21
     * @param MigrationCreator $creator
22
     */
23
    public function __construct(MigrationCreator $creator)
24
    {
25
        parent::__construct();
26
        $this->creator = $creator;
27
    }
28
29
    /**
30
     * @throws \Exception
31
     */
32
    public function handle()
33
    {
34
        $this->prepareConsoleStyles();
35
        $versionPath = $this->creator->create();
36
37
        $this->output->writeln(sprintf('<info>Deploy migration generated in %s</info>', $versionPath));
38
    }
39
}