/**
  * Lists all available users.
  */
 public function listUsersCommand()
 {
     // If we're in Neos context, we pass on the command.
     if ($this->shouldUseNeosService()) {
         $cliRequest = new Request($this->request);
         $cliRequest->setControllerObjectName(UserCommandController::class);
         $cliRequest->setControllerCommandName('list');
         $cliResponse = new Response($this->response);
         $this->dispatcher->dispatch($cliRequest, $cliResponse);
         return;
     }
     /** @var User[] $users */
     $users = $this->userRepository->findAll()->toArray();
     usort($users, function ($a, $b) {
         /** @var User $a */
         /** @var User $b */
         return $a->getEmail() > $b->getEmail();
     });
     $tableRows = [];
     $headerRow = ['Email', 'Name', 'Role(s)'];
     foreach ($users as $user) {
         $tableRows[] = [$user->getEmail(), $user->getFullName(), implode(' ,', $user->getAccount()->getRoles())];
     }
     $this->output->outputTable($tableRows, $headerRow);
     $this->outputLine(sprintf('  <b>%s users total.</b>', count($users)));
 }