Passed
Branch master (a0cc06)
by Dāvis
17:06
created

TranslationsGenerateCommand   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
dl 0
loc 12
rs 10
c 1
b 0
f 1
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A execute() 0 5 1
A configure() 0 3 1
1
<?php
2
3
namespace Sludio\HelperBundle\Translatable\Command;
4
5
use Sludio\HelperBundle\Translatable\Repository\TranslatableRepository as Sludio;
6
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
7
use Symfony\Component\Console\Input\InputInterface;
8
use Symfony\Component\Console\Output\OutputInterface;
9
10
class TranslationsGenerateCommand extends ContainerAwareCommand
11
{
12
    protected function configure()
13
    {
14
        $this->setName('sludio:translations:generate')->setDescription('Regenerate translations');
15
    }
16
17
    protected function execute(InputInterface $input, OutputInterface $output)
18
    {
19
        $output->writeln('Starting generation...');
20
        Sludio::getAllTranslations();
21
        $output->writeln('Translations generated!');
22
    }
23
}
24