From 7eae3513ac623bf97e9ccb0178c669c5b019caf2 Mon Sep 17 00:00:00 2001 From: Emma Fabre Date: Thu, 27 Jun 2024 15:03:10 +0200 Subject: [PATCH] Linting --- .../Integrations/Controllers/IntegrationController.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/Domain/Integrations/Controllers/IntegrationController.php b/app/Domain/Integrations/Controllers/IntegrationController.php index f0058a936..cd05d6be9 100644 --- a/app/Domain/Integrations/Controllers/IntegrationController.php +++ b/app/Domain/Integrations/Controllers/IntegrationController.php @@ -72,8 +72,7 @@ public function __construct( private readonly KeyVisibilityUpgradeRepository $keyVisibilityUpgradeRepository, private readonly SearchService $searchClient, private readonly CurrentUser $currentUser - ) - { + ) { } public function index(Request $request): Response @@ -172,13 +171,14 @@ public function show(string $id): Response $integration = $this->integrationRepository->getById(Uuid::fromString($id)); $oldCredentialsExpirationDate = $this->getExpirationDateForOldCredentials($integration->getKeyVisibilityUpgrade()); - $organizerIds = collect($integration->organizers())->map(fn(Organizer $organizer) => $organizer->organizerId->toString()); - $organizers = collect($this->searchClient->findUiTPASOrganizers(...$organizerIds)->getMember()->getItems())->map(function (SapiOrganizer $organizer) { + $organizerIds = collect($integration->organizers())->map(fn (Organizer $organizer) => $organizer->organizerId->toString()); + $uitpasOrganizers = $this->searchClient->findUiTPASOrganizers(...$organizerIds)->getMember()?->getItems(); + $organizers = collect($uitpasOrganizers)->map(function (SapiOrganizer $organizer) { $id = explode('/', $organizer->getId() ?? ''); return [ 'id' => $id[count($id) - 1], - 'name' => $organizer->getName()->getValues(), + 'name' => $organizer->getName()?->getValues() ?? $id, 'status' => $organizer->getWorkflowStatus() === 'ACTIVE' ? 'Live' : 'Test', ]; });