public function getCategoriesAverageScore(ClientSurvey $client_survey, Collection $categories, string $locale, array $applicant_ids = []): array 	{ 		$dataProvider = new DataProvider(new DatabaseRawDataFetcher); 		$categories_with_avg_score = [];  		$categories->each(function (Category $category) use (&$client_survey, &$applicant_ids, &$locale, &$categories_with_avg_score, &$dataProvider): void { 			$categoryBasedAnswers = $dataProvider->fetchGeneralReportAnswers($category->questions->pluck('id')->all(), $applicant_ids);  			$totalAnswers = 0; 			$totalAnwersMaxPossible = 0;  			foreach ($categoryBasedAnswers as $answer) { 				$totalAnwersMaxPossible += $answer->answer_value_count; 				$totalAnswers += ($answer->answer_value_count * (int) $answer->value); 			}  			$totalCategoriesAverage = $totalAnwersMaxPossible == 0 ? 0 : round($totalAnswers / ($totalAnwersMaxPossible * 4), 3); 			$totalCategoriesAverageTurnedIntoScale4 = round(4 * $totalCategoriesAverage, 3);  			array_push($categories_with_avg_score, [ 				'name' => $category->getTranslation('name', $locale), 				'year' => $client_survey->survey->year, 				'score' => $totalCategoriesAverageTurnedIntoScale4, 				'ordering' => $category->ordering, 				'code' => $category->code, 				'image_url' => $category->storage()->getFirstFile('image')?->getUrl(), 			]); 		});  		return $categories_with_avg_score; 	}