Completed
Push — master ( 55a9c0...ed128c )
by Emil
14:56
created

SyncCommand   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A configure() 0 6 1
A execute() 0 6 1
1
<?php
2
3
namespace Glooby\TaskBundle\Command\Scheduler;
4
5
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
6
use Symfony\Component\Console\Input\InputInterface;
7
use Symfony\Component\Console\Input\InputOption;
8
use Symfony\Component\Console\Output\OutputInterface;
9
10
/**
11
 * @author Emil Kilhage
12
 */
13
class SyncCommand extends ContainerAwareCommand
14
{
15
    /**
16
     * {@inheritdoc}
17
     */
18
    protected function configure()
19
    {
20
        $this->setName('scheduler:sync');
21
        $this->addOption('silent', 'S', InputOption::VALUE_NONE);
22
        $this->addOption('force', 'F', InputOption::VALUE_NONE);
23
    }
24
25
    /**
26
     * {@inheritdoc}
27
     */
28
    protected function execute(InputInterface $input, OutputInterface $output)
29
    {
30
        $client = $this->getContainer()->get('glooby_task.schedule_synchronizer');
31
        $client->setForce($input->getOption('force'));
32
        $client->sync();
33
    }
34
}
35