From 2f9f4dc405eca9a2126a75eb898507174166174e Mon Sep 17 00:00:00 2001 From: Fabien Salathe Date: Sat, 17 May 2025 00:21:34 +0900 Subject: [PATCH] Extract request creation to simplify customization --- src/Runner.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Runner.php b/src/Runner.php index afb704d..95f985c 100644 --- a/src/Runner.php +++ b/src/Runner.php @@ -41,7 +41,7 @@ public function run(): int // Merge the environment variables coming from DotEnv with the ones tied to the current request $_SERVER += $server; - $sfRequest = Request::createFromGlobals(); + $sfRequest = $this->getSymfonyRequest(); $sfResponse = $this->kernel->handle($sfRequest); $sfResponse->send(); @@ -60,4 +60,9 @@ public function run(): int return 0; } + + protected function getSymfonyRequest(): Request + { + return Request::createFromGlobals(); + } }