Skip to content

Commit

Permalink
Fixed potential type error
Browse files Browse the repository at this point in the history
  • Loading branch information
Toflar committed Sep 5, 2023
1 parent 8c3cb92 commit 2dec6d0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Step/FileParameterBag.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 2dec6d0

Please # to comment.