From cd0068c086749f0f8d56090c804c6f7d2c769c4c Mon Sep 17 00:00:00 2001 From: Driss Date: Mon, 11 Nov 2024 16:36:37 +0100 Subject: [PATCH] Refactor Form Package: Simplify array access for query and request parameters --- Extension/HttpFoundation/HttpFoundationRequestHandler.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Extension/HttpFoundation/HttpFoundationRequestHandler.php b/Extension/HttpFoundation/HttpFoundationRequestHandler.php index d7875e7b0..668ab2f0c 100644 --- a/Extension/HttpFoundation/HttpFoundationRequestHandler.php +++ b/Extension/HttpFoundation/HttpFoundationRequestHandler.php @@ -61,7 +61,7 @@ public function handleRequest(FormInterface $form, mixed $request = null): void return; } - $data = $request->query->all()[$name]; + $data = $request->query->all($name); } } else { // Mark the form with an error if the uploaded size was too large @@ -85,7 +85,7 @@ public function handleRequest(FormInterface $form, mixed $request = null): void $files = $request->files->all(); } elseif ($request->request->has($name) || $request->files->has($name)) { $default = $form->getConfig()->getCompound() ? [] : null; - $params = $request->request->all()[$name] ?? $default; + $params = $request->request->all($name) ?? $default; $files = $request->files->get($name, $default); } else { // Don't submit the form if it is not present in the request