'[a-zA-Z0-9\-]*', 'suffix' => 'png|svg|jpg|webmanifest', ] )] public function getSystemImages(string $filename, string $suffix): BinaryFileResponse|RedirectResponse { try { return $this->systemImageUtils->getBinaryFileResponse($filename, $suffix); } catch (FileNotFoundException $e) { if (isDevelopment() && ($url = $this->systemImageUtils->getImageSrcRemote($filename, $suffix))) { return new RedirectResponse($url); } throw $this->createNotFoundException("File /system-images/{$filename}.{$suffix} not found."); } } #[Route(path: '/favicon.ico')] public function getFaviconIco(): BinaryFileResponse|RedirectResponse { try { return $this->systemImageUtils->getBinaryFileResponse('favicon', 'ico'); } catch (FileNotFoundException $e) { if (isDevelopment() && ($url = $this->systemImageUtils->getImageSrcRemote('favicon', 'ico'))) { return new RedirectResponse($url); } throw $this->createNotFoundException('File favicon.ico not found.'); } } }