fix:更新已知bug,优化代码
This commit is contained in:
10
vendor/symfony/http-foundation/FileBag.php
vendored
10
vendor/symfony/http-foundation/FileBag.php
vendored
@@ -43,7 +43,7 @@ class FileBag extends ParameterBag
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function set(string $key, $value)
|
||||
public function set(string $key, mixed $value)
|
||||
{
|
||||
if (!\is_array($value) && !$value instanceof UploadedFile) {
|
||||
throw new \InvalidArgumentException('An uploaded file must be an array or an instance of UploadedFile.');
|
||||
@@ -65,11 +65,9 @@ class FileBag extends ParameterBag
|
||||
/**
|
||||
* Converts uploaded files to UploadedFile instances.
|
||||
*
|
||||
* @param array|UploadedFile $file A (multi-dimensional) array of uploaded file information
|
||||
*
|
||||
* @return UploadedFile[]|UploadedFile|null
|
||||
*/
|
||||
protected function convertFileInformation($file)
|
||||
protected function convertFileInformation(array|UploadedFile $file): array|UploadedFile|null
|
||||
{
|
||||
if ($file instanceof UploadedFile) {
|
||||
return $file;
|
||||
@@ -106,10 +104,8 @@ class FileBag extends ParameterBag
|
||||
*
|
||||
* It's safe to pass an already converted array, in which case this method
|
||||
* just returns the original array unmodified.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function fixPhpFilesArray(array $data)
|
||||
protected function fixPhpFilesArray(array $data): array
|
||||
{
|
||||
// Remove extra key added by PHP 8.1.
|
||||
unset($data['full_path']);
|
||||
|
||||
Reference in New Issue
Block a user