environment) { $io->error('The database anonymizer is disabled in the prod environment.'); return Command::FAILURE; } try { $report = $this->databaseAnonymizer->anonymizeAll(); } catch (\Throwable $exception) { $this->logger->error('Database anonymization failed', [ 'environment' => $this->environment, 'error' => $exception->getMessage(), ]); $io->error($exception->getMessage()); return Command::FAILURE; } $io->success(sprintf( 'Anonymized %d users, %d newsletter consents, %d newsletter opt-in requests, %d booking drafts, and %d accommodation bookings.', $report['users'], $report['newsletterConsents'], $report['newsletterOptInRequests'], $report['bookingEditDrafts'], $report['accommodationBookings'], )); return Command::SUCCESS; } }