userManager = $userManager; $this->accountService = $accountService; $this->cacheActorService = $cacheActorService; $this->configService = $configService; $this->miscService = $miscService; } protected function configure() { parent::configure(); $this->setName('social:account:create') ->addArgument('userId', InputArgument::REQUIRED, 'Nextcloud username of the account') ->addOption('handle', '', InputOption::VALUE_REQUIRED, 'social handle') ->setDescription('Create a new social account'); } /** * @throws Exception */ protected function execute(InputInterface $input, OutputInterface $output): int { $userId = $input->getArgument('userId'); if (($handle = $input->getOption('handle')) === null) { $handle = $userId; } if ($this->userManager->get($userId) === null) { throw new Exception('Unknown user'); } $this->accountService->createActor($userId, $handle); return 0; } }