function PsrHttpFactory::getFiles
Converts Symfony uploaded files array to the PSR one.
File
-
vendor/
symfony/ psr-http-message-bridge/ Factory/ PsrHttpFactory.php, line 118
Class
- PsrHttpFactory
- Builds Psr\HttpMessage instances using a PSR-17 implementation.
Namespace
Symfony\Bridge\PsrHttpMessage\FactoryCode
private function getFiles(array $uploadedFiles) : array {
$files = [];
foreach ($uploadedFiles as $key => $value) {
if (null === $value) {
$files[$key] = $this->uploadedFileFactory
->createUploadedFile($this->streamFactory
->createStream(), 0, \UPLOAD_ERR_NO_FILE);
continue;
}
if ($value instanceof UploadedFile) {
$files[$key] = $this->createUploadedFile($value);
}
else {
$files[$key] = $this->getFiles($value);
}
}
return $files;
}