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

RunCommand   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A configure() 0 4 1
A execute() 0 9 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\Output\OutputInterface;
8
9
/**
10
 * @author Emil Kilhage
11
 */
12
class RunCommand extends ContainerAwareCommand
13
{
14
    /**
15
     * {@inheritdoc}
16
     */
17
    protected function configure()
18
    {
19
        $this->setName('scheduler:run');
20
    }
21
22
    /**
23
     * {@inheritdoc}
24
     */
25
    protected function execute(InputInterface $input, OutputInterface $output)
26
    {
27
        $runner = $this->getContainer()->get('glooby_task.queue_processor');
28
        $runner->setOutput($output);
29
        $runner->process();
30
31
        $scheduler = $this->getContainer()->get('glooby_task.queue_scheduler');
32
        $scheduler->schedule();
33
    }
34
}
35