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

MakeCommand::configure()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 8

Duplication

Lines 10
Ratio 100 %

Importance

Changes 0
Metric Value
cc 1
eloc 8
nc 1
nop 0
dl 10
loc 10
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace Yarak\Commands;
4
5
use Yarak\Config\Config;
6
use Yarak\Console\CommandCreator;
7
use Symfony\Component\Console\Input\InputArgument;
8
9 View Code Duplication
class MakeCommand extends YarakCommand
1 ignored issue
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...
10
{
11
    /**
12
     * Configure the command.
13
     */
14
    protected function configure()
15
    {
16
        $this->setName('make:command')
17
            ->setDescription('Create a new command file.')
18
            ->setHelp('This command will generate a new command file.')
19
            ->addArgument(
20
                'name',
21
                InputArgument::REQUIRED,
22
                'The name of your command file.');
23
    }
24
25
    /**
26
     * Handle the command.
27
     */
28
    protected function handle()
29
    {
30
        $creator = new CommandCreator(
31
            Config::getInstance($this->configArray),
32
            $this->getOutput()
33
        );
34
35
        $creator->create($this->argument('name'));
36
    }
37
}
38