From 8e95b8d3a6b739b41736d855a573c40ac2e9fbdb Mon Sep 17 00:00:00 2001
From: Darren Fisher <60905-darren.fisher@users.noreply.drupalcode.org>
Date: Fri, 3 Jan 2025 12:50:02 +0000
Subject: [PATCH] Provide default response when the file is not found in
 system_file_download function to satisfy phpstan.

---
 core/modules/system/system.module | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/core/modules/system/system.module b/core/modules/system/system.module
index b4c20f11beee..230d476eb094 100644
--- a/core/modules/system/system.module
+++ b/core/modules/system/system.module
@@ -587,6 +587,8 @@ function system_file_download($uri): Response {
         if (array_intersect($parts, ['.', '..'])) {
           return -1;
         }
+        // Default response when the file is not found.
+        return new Response('File not found', 404);
       }
     }
   }
-- 
GitLab