addArgument('key', InputArgument::REQUIRED, 'Config key') ->addArgument('value', InputArgument::REQUIRED, 'Config value') ; } protected function execute(InputInterface $input, OutputInterface $output): int { $io = new SymfonyStyle($input, $output); $key = $input->getArgument('key'); $handlers = [ 'auth.method' => 'setAuthMethod', ]; $handler = $handlers[$key]; $this->$handler($input, $io); $io->success('Success: "' . $input->getArgument('key') . '" set to "' . $input->getArgument('value') . '"'); return Command::SUCCESS; } private function setAuthMethod(InputInterface $input, SymfonyStyle $io) { $config = [ 'local' => 'config/dist/local.security.yaml', 'ldap' => 'config/dist/ldap.security.yaml', ]; $authMethod = $input->getArgument('value'); $io->text('> Setting auth method to: ' . $authMethod); copy($config[$authMethod], 'config/packages/security.yaml'); } }