*/ class GenerateConfigCommand extends Command { /** * @var ConfigGenerator */ private $configGenerator; /** * GenerateConfigCommand constructor. * @param null|string $name * @param ConfigGenerator $configGenerator * @author Soner Sayakci */ public function __construct(?string $name = null, ConfigGenerator $configGenerator) { parent::__construct($name); $this->configGenerator = $configGenerator; } /** * @author Soner Sayakci */ public function configure() { $this ->setName('recast:generate') ->setDescription('Regenerates rtmp config'); } /** * @param InputInterface $input * @param OutputInterface $output * @return int|null|void * @author Soner Sayakci */ public function execute(InputInterface $input, OutputInterface $output) { $this->configGenerator->generate(); $io = new SymfonyStyle($input, $output); $io->success('Configs generated'); } }