InstallCommand::configure()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 3
Bugs 0 Features 1
Metric Value
c 3
b 0
f 1
dl 0
loc 9
rs 9.6666
cc 1
eloc 6
nc 1
nop 0
1
<?php
2
3
namespace kujaff\VersionsBundle\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\Input\InputArgument;
9
10
/**
11
 * Installation after schema update
12
 */
13
class InstallCommand extends ContainerAwareCommand
14
{
15
16
    /**
17
     * {@inherited}
18
     */
19
    protected function configure()
20
    {
21
        $this
22
            ->setName('bundle:install')
23
            ->setDescription('Install a bundle')
24
            ->addArgument('name', InputArgument::REQUIRED)
25
            ->addOption('force')
26
        ;
27
    }
28
29
    /**
30
     * {@inherited}
31
     */
32
    protected function execute(InputInterface $input, OutputInterface $output)
33
    {
34
        $name = $input->getArgument('name');
35
36
        $this->getContainer()->get('versions.installer')->install($name, $input->getOption('force'), $output);
37
    }
38
}
39