Completed
Push — dev ( 6d8737...fe3822 )
by Zach
02:19
created

MigrateRollback::handle()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 0
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace Yarak\Commands;
4
5
use Symfony\Component\Console\Input\InputOption;
6
7
class MigrateRollback extends YarakCommand
8
{
9
    /**
10
     * Configure the command.
11
     */
12
    protected function configure()
13
    {
14
        $this->setName('migrate:rollback')
15
            ->setDescription('Rollback migrations by given number of steps.')
16
            ->setHelp('This command allows you to rollback migrations.')
17
            ->addOption(
18
                'steps',
19
                null,
20
                InputOption::VALUE_OPTIONAL,
21
                'Number of steps to rollback.',
22
                1
23
            );
24
    }
25
26
    /**
27
     * Handle the command.
28
     */
29
    protected function handle()
30
    {
31
        $this->getMigrator($this->getOutput())
32
            ->rollback($this->option('steps'));
33
    }
34
}
35