ListPlacersCommand   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 3
dl 0
loc 26
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A configure() 0 7 1
A execute() 0 13 2
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
    /** {@inheritdoc} */
15
    protected function configure()
16
    {
17
        $this
18
            ->setName('list:placers')
19
            ->setDescription('List all word placers')
20
        ;
21
    }
22
23
    /** {@inheritdoc} */
24
    protected function execute(InputInterface $input, OutputInterface $output)
25
    {
26
        $placers = PlacerFactory::getInstance()->getPlacersNames();
27
        $output->write('Available words placers: ');
28
29
        if (!count($placers)) {
30
            $output->writeln('none');
31
            return;
32
        }
33
34
35
        $output->writeln(join(', ', $placers));
36
    }
37
}
38