security->isGranted('ROLE_ADMIN')) { throw new AccessDeniedException('Access denied: ROLE_ADMIN required.'); } $report = $this->reportRepository->findById($id); if (null === $report) { throw new InvalidArgumentException(sprintf('CommercialReport with ID %d not found.', $id)); } return json_encode(Serializer::commercialReport($report)); } }