protected static function convertFile($file)
    {
        $error = $file->getError();
        $tmpName = '';
        if ($error === UPLOAD_ERR_OK) {
            $tmpName = $file->getStream()->getMetadata('uri');
        }

        return [
            'name' => $file->getClientFilename(),
            'type' => $file->getClientMediaType(),
            'tmp_name' => $tmpName,
            'error' => $error,
            'size' => $file->getSize(),
        ];
    }
protected static function convertFile($file)
    {
        $error = $file->getError();
        $tmpName = '';
        if ($error === UPLOAD_ERR_OK) {
            $tmpName = $file->getStream()->getMetadata('uri');
        }

        return [
            'name' => $file->getClientFilename(),
            'type' => $file->getClientMediaType(),
            'tmp_name' => $tmpName,
            'error' => $error,
            'size' => $file->getSize(),
        ];
    }
protected static function convertFile ( $ file ) { $ error = $ file -> getError ( ) ; $ tmpName = '' ; if ( $ error === UPLOAD_ERR_OK ) { $ tmpName = $ file -> getStream ( ) -> getMetadata ( 'uri' ) ; } return [ 'name' => $ file -> getClientFilename ( ) , 'type' => $ file -> getClientMediaType ( ) , 'tmp_name' => $ tmpName , 'error' => $ error , 'size' => $ file -> getSize ( ) , ] ; }
Convert a single file back into an array.

@param \Psr\Http\Message\UploadedFileInterface $file The file to convert.
@return array
Convert a single file back into an array .