Completed
Push — master ( 7c1eaa...80d841 )
by Joachim
15:53
created

SyncTerminalsCommand::execute()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
rs 10
cc 1
eloc 2
nc 1
nop 2
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 setTerminalSynchronizer(TerminalSynchronizer $terminalSynchronizer)
18
    {
19
        $this->terminalSynchronizer = $terminalSynchronizer;
20
    }
21
22
    protected function configure()
23
    {
24
        $this->setName('loevgaard:dandomain:altapay:sync-terminals')
25
            ->setDescription('Synchronizes terminals from Altapay to the local database (one way sync)')
26
        ;
27
    }
28
29
    protected function execute(InputInterface $input, OutputInterface $output)
30
    {
31
        $this->terminalSynchronizer->syncAll();
32
    }
33
}
34