public function getCompaniesRanked(ClientSurvey $client_survey): array 	{ 		$client_surveys = ClientSurvey::viableClientSurveys()->where('survey_type', SurveyType::IZZ->value) 		->where('company_size', $client_survey->company_size) 		->whereHas('survey', function ($query) use ($client_survey) { 			$query->where('year', $client_survey->survey->year); 		})->where('domain_id', $client_survey->domain_id)->get();  		$companies_ranked = []; 		$compared_id = $client_survey->getKey();  		$benchmarkReportService = new BenchmarkReportService;  		/** @var ClientSurvey $client_survey 		 */ 		foreach ($client_surveys as $client_survey) { 			$categories_data = $benchmarkReportService->calculateClientSurveyFinalGrade($client_survey); 			$score = count($categories_data) ? number_format(array_sum(array_column($categories_data, 'score')) / count($categories_data), 3) : null;  			$match_made = $client_survey->getKey() === $compared_id;  			$companies_ranked[] = [ 				'matches_compared' => $match_made ? true : false, 				'company_name' => $client_survey->client?->authParent->name ?? '-', 				'total_grade' => $score, 			]; 		}  		$companies_ranked = collect($companies_ranked)->sortBy(function ($item) { 			return $item['total_grade']; 		}, SORT_REGULAR, true)->all();  		$iteration = 1;  		return array_map(function ($val) use (&$iteration) { 			$val['iteration'] = $iteration++;  			if ($val['iteration'] > 3 && !$val['matches_compared']) { 				$val['company_name'] = __('benchmark-report-pdf.hidden-results', [], 'en'); 			}  			return $val; 		}, $companies_ranked); 	}