From 2dec6d0c108a0edbc4abdd848996f0c401f5cb39 Mon Sep 17 00:00:00 2001 From: Yanick Witschi Date: Tue, 5 Sep 2023 13:27:14 +0200 Subject: [PATCH] Fixed potential type error --- src/Step/FileParameterBag.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Step/FileParameterBag.php b/src/Step/FileParameterBag.php index 69ab276..c6aa470 100644 --- a/src/Step/FileParameterBag.php +++ b/src/Step/FileParameterBag.php @@ -17,7 +17,11 @@ class FileParameterBag extends ParameterBag */ public function set(string $name, mixed $value): self { - if (\array_key_exists('tmp_name', $value) && \is_string($value['tmp_name']) && is_uploaded_file($value['tmp_name'])) { + if (\is_array($value) && + \array_key_exists('tmp_name', $value) && + \is_string($value['tmp_name']) + && is_uploaded_file($value['tmp_name']) + ) { $target = (new Filesystem())->tempnam(sys_get_temp_dir(), 'nc'); move_uploaded_file($value['tmp_name'], $target); $value['tmp_name'] = $target;