Code Duplication    Length = 25-26 lines in 4 locations

src/Eccube/Command/ComposerRemoveCommand.php 1 location

@@ 22-46 (lines=25) @@
19
use Symfony\Component\Console\Input\InputInterface;
20
use Symfony\Component\Console\Output\OutputInterface;
21
22
class ComposerRemoveCommand extends Command
23
{
24
    protected static $defaultName = 'eccube:composer:remove';
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
    }
41
42
    protected function execute(InputInterface $input, OutputInterface $output)
43
    {
44
        $this->composerService->execRemove($input->getArgument('package'), $output);
45
    }
46
}
47

src/Eccube/Command/ComposerRequireCommand.php 1 location

@@ 22-47 (lines=26) @@
19
use Symfony\Component\Console\Input\InputInterface;
20
use Symfony\Component\Console\Output\OutputInterface;
21
22
class ComposerRequireCommand extends Command
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

src/Eccube/Command/ComposerInstallCommand.php 1 location

@@ 21-45 (lines=25) @@
18
use Symfony\Component\Console\Input\InputInterface;
19
use Symfony\Component\Console\Output\OutputInterface;
20
21
class ComposerInstallCommand extends Command
22
{
23
    protected static $defaultName = 'eccube:composer:install';
24
25
    /**
26
     * @var ComposerApiService
27
     */
28
    private $composerService;
29
30
    public function __construct(ComposerApiService $composerService)
31
    {
32
        parent::__construct();
33
        $this->composerService = $composerService;
34
    }
35
36
    protected function configure()
37
    {
38
        $this->addOption('dry-run');
39
    }
40
41
    protected function execute(InputInterface $input, OutputInterface $output)
42
    {
43
        $this->composerService->execUpdate($input->getOption('dry-run'), $output);
44
    }
45
}
46

src/Eccube/Command/ComposerUpdateCommand.php 1 location

@@ 21-45 (lines=25) @@
18
use Symfony\Component\Console\Input\InputInterface;
19
use Symfony\Component\Console\Output\OutputInterface;
20
21
class ComposerUpdateCommand extends Command
22
{
23
    protected static $defaultName = 'eccube:composer:update';
24
25
    /**
26
     * @var ComposerApiService
27
     */
28
    private $composerService;
29
30
    public function __construct(ComposerApiService $composerService)
31
    {
32
        parent::__construct();
33
        $this->composerService = $composerService;
34
    }
35
36
    protected function configure()
37
    {
38
        $this->addOption('dry-run');
39
    }
40
41
    protected function execute(InputInterface $input, OutputInterface $output)
42
    {
43
        $this->composerService->execUpdate($input->getOption('dry-run'), $output);
44
    }
45
}
46