| @@ 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 | ||
| @@ 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 | ||