standardResponseMapper->map($soapResponse->ReponseStandard ?? null); $specificResponseNode = $soapResponse->ReponseSpecifique ?? null; $bovinNode = is_object($specificResponseNode) ? ($specificResponseNode->Bovin ?? null) : null; $identification = null; $presencePeriods = []; if (is_object($bovinNode)) { $identificationNode = $bovinNode->IdentiteBovin ?? null; if (is_object($identificationNode)) { $identification = $this->mapIdentification($identificationNode); } $presencePeriodsNode = $bovinNode->PeriodesPresences->PeriodePresence ?? null; foreach ($this->normalizeToList($presencePeriodsNode) as $presencePeriodNode) { if (!is_object($presencePeriodNode)) { continue; } $presencePeriods[] = $this->mapPresencePeriod($presencePeriodNode); } } return new AnimalFileDto( standardResponse: $standardResponse, identification: $identification, presencePeriods: $presencePeriods, rawSoapResponse: $soapResponse ); } }