Passed
Pull Request — development (#671)
by Nick
06:47
created

ImportLegacyTranslationCommand::configure()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 8
Ratio 100 %

Importance

Changes 0
Metric Value
cc 1
eloc 5
nc 1
nop 0
dl 8
loc 8
rs 9.4285
c 0
b 0
f 0
1
<?php
2
/***************************************************************************
3
 * For license information see LICENSE.md
4
 ***************************************************************************/
5
6
namespace Oc\Command;
7
8
use Oc\Translation\CrowdinImport;
9
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
10
use Symfony\Component\Console\Exception\InvalidArgumentException;
11
use Symfony\Component\Console\Input\InputInterface;
12
use Symfony\Component\Console\Output\OutputInterface;
13
14
/**
15
 * Class ImportLegacyTranslationCommand.
16
 *
17
 * Very quick and dirty solution to import crowdin snippets into the legacy translation system
18
 *
19
 * @package Oc\Command
20
 */
21 View Code Duplication
class ImportLegacyTranslationCommand extends ContainerAwareCommand
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
22
{
23
    const COMMAND_NAME = 'translation:import-legacy-translation';
24
25
    /**
26
     * Configures the command.
27
     *
28
     * @return void
29
     *
30
     * @throws InvalidArgumentException
31
     */
32
    protected function configure()
33
    {
34
        parent::configure();
35
36
        $this
37
            ->setName(self::COMMAND_NAME)
38
            ->setDescription('import translation from crowdin into legacy translation system');
39
    }
40
41
    /**
42
     * Executes the command.
43
     *
44
     * @param InputInterface $input
45
     * @param OutputInterface $output
46
     *
47
     * @return int|null
48
     */
49
    protected function execute(InputInterface $input, OutputInterface $output)
50
    {
51
        $this->getContainer()->get(CrowdinImport::class)->importTranslations();
52
    }
53
}
54