VhostListCommand   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
lcom 0
cbo 4
dl 0
loc 26
ccs 0
cts 15
cp 0
rs 10
c 1
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A configure() 0 6 1
A execute() 0 10 1
1
<?php
2
3
namespace Portiere\Command;
4
5
use Portiere\WebServer\ManagerFactory;
6
use Symfony\Component\Console\Command\Command;
7
use Symfony\Component\Console\Input\InputInterface;
8
use Symfony\Component\Console\Output\OutputInterface;
9
use Symfony\Component\Console\Style\SymfonyStyle;
10
11
/**
12
 * Class VhostListCommand.
13
 *
14
 * @author Ignacio Velazquez <[email protected]>
15
 */
16
class VhostListCommand extends Command
17
{
18
    /**
19
     * {@inheritdoc}
20
     */
21
    protected function configure()
22
    {
23
        $this
24
            ->setName('vhost:list')
25
            ->setDescription('List vhosts');
26
    }
27
28
    /**
29
     * {@inheritdoc}
30
     */
31
    protected function execute(InputInterface $input, OutputInterface $output)
32
    {
33
        $io = new SymfonyStyle($input, $output);
34
        $manager = ManagerFactory::create();
35
36
        $io->table(
37
            ['Vhost Name', 'Enabled'],
38
            $manager->listVhosts()
39
        );
40
    }
41
}
42