Completed
Push — master ( 2604a0...14e09a )
by Joachim
02:14
created

SyncTerminalsCommand   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A configure() 0 6 1
A execute() 0 4 1
1
<?php
2
3
namespace Loevgaard\DandomainAltapayBundle\Command;
4
5
use Loevgaard\DandomainAltapayBundle\Synchronizer\TerminalSynchronizer;
6
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
7
use Symfony\Component\Console\Input\InputInterface;
8
use Symfony\Component\Console\Output\OutputInterface;
9
10
class SyncTerminalsCommand extends ContainerAwareCommand
11
{
12
    /**
13
     * @var TerminalSynchronizer
14
     */
15
    protected $terminalSynchronizer;
16
17
    public function __construct(TerminalSynchronizer $terminalSynchronizer)
18
    {
19
        $this->terminalSynchronizer = $terminalSynchronizer;
20
21
        parent::__construct();
22
    }
23
24
    protected function configure()
25
    {
26
        $this->setName('loevgaard:dandomain:altapay:sync-terminals')
27
            ->setDescription('Synchronizes terminals from Altapay to the local database (one way sync)')
28
        ;
29
    }
30
31
    protected function execute(InputInterface $input, OutputInterface $output)
32
    {
33
        $this->terminalSynchronizer->syncAll();
34
    }
35
}
36