Converts uploaded files to UploadedFile instances.
array|UploadedFile $file A (multi-dimensional) array of uploaded file information:
array A (multi-dimensional) array of UploadedFile instances
protected function convertFileInformation($file) {
if ($file instanceof UploadedFile) {
return $file;
}
$file = $this
->fixPhpFilesArray($file);
if (is_array($file)) {
$keys = array_keys($file);
sort($keys);
if ($keys == self::$fileKeys) {
if (UPLOAD_ERR_NO_FILE == $file['error']) {
$file = null;
}
else {
$file = new UploadedFile($file['tmp_name'], $file['name'], $file['type'], $file['size'], $file['error']);
}
}
else {
$file = array_map(array(
$this,
'convertFileInformation',
), $file);
}
}
return $file;
}