SynchronizeCommand::execute()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 5
ccs 0
cts 5
cp 0
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 2
crap 2
1
<?php
2
3
namespace Happyr\TranslationBundle\Command;
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
 * Once you have downloaded all the translations you may want to synchronize with the progress from the translators.
11
 * This command will keep your placeholders for missing translations.
12
 */
13
class SynchronizeCommand extends ContainerAwareCommand
14
{
15
    /**
16
     * {@inheritdoc}
17
     */
18
    protected function configure()
19
    {
20
        $this
21
            ->setName('happyr:translation:sync')
22
            ->setDescription('Sync all your translations with SaaS. Leave place holders for missing translations.');
23
    }
24
    /**
25
     * {@inheritdoc}
26
     */
27
    protected function execute(InputInterface $input, OutputInterface $output)
28
    {
29
        $this->getContainer()->get('happyr.translation')->synchronizeAllTranslations();
30
        $output->writeln('Synchronization complete');
31
    }
32
}
33