CreateMigrationCommand::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 4
rs 10
c 0
b 0
f 0
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
}