src/PSR7Client.php
private function wrapUploads($files): array
    {
        if (empty($files)) {
            return [];
        }

        $result = [];
        foreach ($files as $index => $f) {
            if (!isset($f['name'])) {
                $result[$index] = $this->wrapUploads($f);
                continue;
            }

            if (UPLOAD_ERR_OK === $f['error']) {
                $stream = $this->streamFactory->createStreamFromFile($f['tmpName']);
            } else {
                $stream = $this->streamFactory->createStream();
            }

            $result[$index] = $this->uploadsFactory->createUploadedFile(
                $stream,
                $f['size'],
                $f['error'],
                $f['name'],
                $f['mime']
            );
        }

        return $result;
    }
private function wrapUploads($files): array
    {
        if (empty($files)) {
            return [];
        }

        $result = [];
        foreach ($files as $index => $f) {
            if (!isset($f['name'])) {
                $result[$index] = $this->wrapUploads($f);
                continue;
            }

            if (UPLOAD_ERR_OK === $f['error']) {
                $stream = $this->streamFactory->createStreamFromFile($f['tmpName']);
            } else {
                $stream = $this->streamFactory->createStream();
            }

            $result[$index] = $this->uploadsFactory->createUploadedFile(
                $stream,
                $f['size'],
                $f['error'],
                $f['name'],
                $f['mime']
            );
        }

        return $result;
    }
private function wrapUploads ( $ files ) : array { if ( empty ( $ files ) ) { return [ ] ; } $ result = [ ] ; foreach ( $ files as $ index => $ f ) { if ( ! isset ( $ f [ 'name' ] ) ) { $ result [ $ index ] = $ this -> wrapUploads ( $ f ) ; continue ; } if ( UPLOAD_ERR_OK === $ f [ 'error' ] ) { $ stream = $ this -> streamFactory -> createStreamFromFile ( $ f [ 'tmpName' ] ) ; } else { $ stream = $ this -> streamFactory -> createStream ( ) ; } $ result [ $ index ] = $ this -> uploadsFactory -> createUploadedFile ( $ stream , $ f [ 'size' ] , $ f [ 'error' ] , $ f [ 'name' ] , $ f [ 'mime' ] ) ; } return $ result ; }
Wraps all uploaded files with UploadedFile.

@param array $files

@return array
Wraps all uploaded files with UploadedFile .