*/ public function describe(string $exportAlias, array $exportOptions, bool $includeExportTitle = true): array { $output = []; $denormalized = $this->exportConfigNormalizer->denormalizeConfig($exportAlias, $exportOptions); $user = $this->security->getUser(); if ($includeExportTitle) { $output[] = $this->trans($this->exportManager->getExport($exportAlias)->getTitle()); } if (!$user instanceof User) { return $output; } $context = new ExportGenerationContext($user); foreach ($this->exportConfigProcessor->retrieveUsedFilters($denormalized['filters']) as $name => $filter) { $output[] = $this->trans($filter->describeAction($denormalized['filters'][$name]['form'], $context)); } foreach ($this->exportConfigProcessor->retrieveUsedAggregators($denormalized['aggregators']) as $name => $aggregator) { $output[] = $this->trans($aggregator->getTitle()); } return $output; } private function trans(string|TranslatableInterface|array $translatable): string { if (is_string($translatable)) { return $this->translator->trans($translatable); } if ($translatable instanceof TranslatableInterface) { return $translatable->trans($this->translator); } // array case return $this->translator->trans($translatable[0], $translatable[1] ?? []); } }