UpdateCommand::configure()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 1
Metric Value
c 2
b 0
f 1
dl 0
loc 8
rs 9.4285
cc 1
eloc 5
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
 * Update a bundle
12
 */
13
class UpdateCommand extends ContainerAwareCommand
14
{
15
16
    /**
17
     * {@inherited}
18
     */
19
    protected function configure()
20
    {
21
        $this
22
            ->setName('bundle:update')
23
            ->setDescription('Update a bundle')
24
            ->addArgument('name', InputArgument::REQUIRED)
25
        ;
26
    }
27
28
    /**
29
     * {@inherited}
30
     */
31
    protected function execute(InputInterface $input, OutputInterface $output)
32
    {
33
        $name = $input->getArgument('name');
34
        $this->getContainer()->get('versions.installer')->update($name, null, $output);
35
    }
36
}
37