Completed
Push — master ( 6f4157...308843 )
by Craig
05:11
created

configure()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 4
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the Zikula package.
7
 *
8
 * Copyright Zikula Foundation - https://ziku.la/
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
namespace Zikula\SettingsModule\Command;
15
16
use Symfony\Component\Console\Command\Command;
17
use Symfony\Component\Console\Input\InputInterface;
18
use Symfony\Component\Console\Output\OutputInterface;
19
use Symfony\Component\Console\Style\SymfonyStyle;
20
use Zikula\SettingsModule\Helper\TranslationConfigHelper;
21
22
class UpdateTranslationConfigurationsCommand extends Command
23
{
24
    protected static $defaultName = 'zikula:translation:updateconfig';
25
26
    /**
27
     * @var TranslationConfigHelper
28
     */
29
    private $translationConfigHelper;
30
31
    public function __construct(TranslationConfigHelper $translationConfigHelper)
32
    {
33
        parent::__construct();
34
        $this->translationConfigHelper = $translationConfigHelper;
35
    }
36
37
    protected function configure()
38
    {
39
        $this
40
            ->setDescription('Updates translation configurations based on currently installed and activated extensions.')
41
        ;
42
    }
43
44
    protected function execute(InputInterface $input, OutputInterface $output): int
45
    {
46
        $io = new SymfonyStyle($input, $output);
47
48
        $this->translationConfigHelper->updateConfiguration();
49
50
        $io->success('Complete');
51
52
        return 0;
53
    }
54
}
55