Completed
Push — master ( 5234da...957f67 )
by Aymen
10:41
created

DefaultCommand   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 49
Duplicated Lines 0 %

Coupling/Cohesion

Components 2
Dependencies 2

Importance

Changes 1
Bugs 1 Features 1
Metric Value
wmc 3
c 1
b 1
f 1
lcom 2
cbo 2
dl 0
loc 49
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A configure() 0 12 1
A initialize() 0 5 1
A execute() 0 7 1
1
<?php
2
3
namespace AppBundle\Command;
4
5
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
6
use Symfony\Component\Console\Input\InputInterface;
7
use Symfony\Component\Console\Output\OutputInterface;
8
use Symfony\Component\Console\Style\SymfonyStyle;
9
10
/**
11
 * Class DefaultCommand.
12
 */
13
class DefaultCommand extends ContainerAwareCommand
14
{
15
    /**
16
     * @var \Symfony\Component\Console\Style\SymfonyStyle
17
     */
18
    protected $style;
19
20
    /**
21
     * {@inheritdoc}
22
     *
23
     * @see \Symfony\Component\Console\Command\Command::configure()
24
     */
25
    protected function configure()
26
    {
27
        $this->setName('app:default:show')
28
            ->setDescription(
29
                'execute command to display message'
30
            )
31
            ->setHelp(
32
                <<<'EOT'
33
execute command app:default:index to display welcome message
34
EOT
35
            );
36
    }
37
38
    /**
39
     * {@inheritdoc}
40
     *
41
     * @see \Symfony\Component\Console\Command\Command::initialize()
42
     */
43
    protected function initialize(InputInterface $input, OutputInterface $output)
44
    {
45
        $this->style = new SymfonyStyle($input, $output);
46
        $this->style->title('AppBundle:Default:Show Command');
47
    }
48
49
    /**
50
     * {@inheritdoc}
51
     *
52
     * @see \Symfony\Component\Console\Command\Command::execute()
53
     */
54
    protected function execute(InputInterface $input, OutputInterface $output)
55
    {
56
        $this->style->write(
57
            'Hello Micro Framework from command'
58
        );
59
        $this->style->newLine(1);
60
    }
61
}
62