protected function handleMultipleFile($file) : array
    {
        $fileBag = [];

        foreach ($file['name'] as $idx => $name) {
            $uploadedFile = null;

            //The current file was uploaded successfully?
            if (!$file[$idx]['error']) {
                $uploadedFile = new UploadedFile(
                    $file[$idx]['tmp_name'],
                    $file[$idx]['name'],
                    $file[$idx]['type']
                );
            }

            $fileBag[$idx] = $uploadedFile;
        }

        return $fileBag;
    }
protected function handleMultipleFile($file) : array
    {
        $fileBag = [];

        foreach ($file['name'] as $idx => $name) {
            $uploadedFile = null;

            //The current file was uploaded successfully?
            if (!$file[$idx]['error']) {
                $uploadedFile = new UploadedFile(
                    $file[$idx]['tmp_name'],
                    $file[$idx]['name'],
                    $file[$idx]['type']
                );
            }

            $fileBag[$idx] = $uploadedFile;
        }

        return $fileBag;
    }
protected function handleMultipleFile ( $ file ) : array { $ fileBag = [ ] ; foreach ( $ file [ 'name' ] as $ idx => $ name ) { $ uploadedFile = null ; //The current file was uploaded successfully? if ( ! $ file [ $ idx ] [ 'error' ] ) { $ uploadedFile = new UploadedFile ( $ file [ $ idx ] [ 'tmp_name' ] , $ file [ $ idx ] [ 'name' ] , $ file [ $ idx ] [ 'type' ] ) ; } $ fileBag [ $ idx ] = $ uploadedFile ; } return $ fileBag ; }
Handle a file input, when it IS 'multiple'.

@param array $file An element from $_FILES superglobal

@return array
Handle a file input when it IS multiple .