Passed
Push — master ( 6e26c0...38e037 )
by Dan
02:58
created

ListPlacersCommand::configure()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
c 1
b 1
f 0
dl 0
loc 7
rs 9.4285
cc 1
eloc 4
nc 1
nop 0
1
<?php
2
3
namespace SixtyNine\Cloud\Command;
4
5
use SixtyNine\Cloud\Factory\PlacerFactory;
6
use Symfony\Component\Console\Command\Command;
7
use Symfony\Component\Console\Input\InputArgument;
8
use Symfony\Component\Console\Input\InputInterface;
9
use Symfony\Component\Console\Input\InputOption;
10
use Symfony\Component\Console\Output\OutputInterface;
11
12
class ListPlacersCommand extends Command
13
{
14
    protected function configure()
15
    {
16
        $this
17
            ->setName('list:placers')
18
            ->setDescription('List all word placers')
19
        ;
20
    }
21
22
    protected function execute(InputInterface $input, OutputInterface $output)
23
    {
24
        $placers = PlacerFactory::getInstance()->getPlacersNames();
25
        $output->write('Available words placers: ');
26
27
        if (!count($placers)) {
28
            $output->writeln('none');
29
            return;
30
        }
31
32
33
        $output->writeln(join(', ', $placers));
34
    }
35
}
36