protected function execute(InputInterface $input, OutputInterface $output) { $uid = $input->getArgument('uid'); $user = $this->userManager->get($uid); if (is_null($user)) { $output->writeln("<error>Invalid UID</error>"); return; } $this->manager->enableTwoFactorAuthentication($user); $output->writeln("Two-factor authentication enabled for user {$uid}"); }