setName(static::$defaultName)->setDescription(static::$defaultDescription); $this->addArgument('name', InputArgument::REQUIRED, 'App plugin name'); } /** * @param InputInterface $input * @param OutputInterface $output * @return int */ protected function execute(InputInterface $input, OutputInterface $output): int { $name = $input->getArgument('name'); $output->writeln("Install App Plugin $name"); $class = "\\plugin\\$name\\api\\Install"; if (!method_exists($class, 'install')) { throw new \RuntimeException("Method $class::install not exists"); } call_user_func([$class, 'install'], config("plugin.$name.app.version")); return self::SUCCESS; } }