Completed
Pull Request — 4.0 (#3567)
by Kiyotaka
07:05 queued 28s
created

ComposerRequireCommand::execute()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 4
Ratio 100 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 2
dl 4
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
/*
4
 * This file is part of EC-CUBE
5
 *
6
 * Copyright(c) LOCKON CO.,LTD. All Rights Reserved.
7
 *
8
 * http://www.lockon.co.jp/
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 Eccube\Command;
15
16
use Eccube\Service\Composer\ComposerApiService;
17
use Symfony\Component\Console\Command\Command;
18
use Symfony\Component\Console\Input\InputArgument;
19
use Symfony\Component\Console\Input\InputInterface;
20
use Symfony\Component\Console\Output\OutputInterface;
21
22 View Code Duplication
class ComposerRequireCommand extends Command
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...
23
{
24
    protected static $defaultName = 'eccube:composer:require';
25
26
    /**
27
     * @var ComposerApiService
28
     */
29
    private $composerService;
30
31
    public function __construct(ComposerApiService $composerService)
32
    {
33
        parent::__construct();
34
        $this->composerService = $composerService;
35
    }
36
37
    protected function configure()
38
    {
39
        $this->addArgument('package', InputArgument::REQUIRED)
40
            ->addArgument('version', InputArgument::OPTIONAL);
41
    }
42
43
    protected function execute(InputInterface $input, OutputInterface $output)
44
    {
45
        $this->composerService->execRequire($input->getArgument('package'), $output);
46
    }
47
}
48