protected function getUserOrFail($username, $authenticationProviderName) { $user = $this->userService->getUser($username, $authenticationProviderName); if (!$user instanceof User) { $this->outputLine('The user "%s" does not exist.', array($username)); $this->quit(1); } return $user; }