TrelloSynchronizationCommand   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 3
eloc 12
dl 0
loc 23
ccs 0
cts 19
cp 0
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A execute() 0 12 2
A configure() 0 6 1
1
<?php
2
3
namespace Scrumban\Command;
4
5
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
6
7
use Symfony\Component\Console\Input\InputInterface;
8
use Symfony\Component\Console\Output\OutputInterface;
9
use Symfony\Component\Console\Input\InputArgument;
10
11
class TrelloSynchronizationCommand extends ContainerAwareCommand
12
{
13
    protected function configure()
14
    {
15
        $this
16
            ->setName('scrumban:trello:sync')
17
            ->setDescription('Synchronize')
18
            ->addArgument('board_name', InputArgument::REQUIRED, 'The configured name of the board you want to synchronize')
19
        ;
20
    }
21
    
22
    protected function execute(InputInterface $input, OutputInterface $output)
23
    {
24
        $output->writeln(
25
            "<fg=white;bg=cyan>\n\n Beginning board synchronization !\n</>\n"
26
        );
27
        $messages = $this->getContainer()->get('scrumban.trello_manager')->sync($input->getArgument('board_name'));
28
        
29
        foreach ($messages as $type => $message) {
30
            $output->writeln("<{$type}>$message</{$type}>");
31
        }
32
        $output->writeln(
33
            "<fg=white;bg=green>\n\n Synchronization is complete !\n</>\n"
34
        );
35
    }
36
}