src/Bynder/Api/Impl/Upload/FileUploader.php
private function hasFinishedSuccessfullyAsync($finalizeResponse)
    {
        // Again using an Iterator function to generate the threads.
        $promises = $this->pollStatusIterator($finalizeResponse);
        $eachPromises = new Promise\EachPromise($promises, [
            'concurrency' => 1,
            'fulfilled' => function ($pollStatus, $i, $promise) {
                if ($pollStatus != null) {
                    if (!empty($pollStatus['itemsDone'])) {
                        $promise->resolve($pollStatus['itemsDone']);
                    }
                    if (!empty($pollStatus['itemsFailed'])) {
                        $promise->resolve(false);
                    }
                }
                return false;
            }
        ]);
        return $eachPromises->promise();
    }
private function hasFinishedSuccessfullyAsync($finalizeResponse)
    {
        // Again using an Iterator function to generate the threads.
        $promises = $this->pollStatusIterator($finalizeResponse);
        $eachPromises = new Promise\EachPromise($promises, [
            'concurrency' => 1,
            'fulfilled' => function ($pollStatus, $i, $promise) {
                if ($pollStatus != null) {
                    if (!empty($pollStatus['itemsDone'])) {
                        $promise->resolve($pollStatus['itemsDone']);
                    }
                    if (!empty($pollStatus['itemsFailed'])) {
                        $promise->resolve(false);
                    }
                }
                return false;
            }
        ]);
        return $eachPromises->promise();
    }
private function hasFinishedSuccessfullyAsync ( $ finalizeResponse ) { // Again using an Iterator function to generate the threads. $ promises = $ this -> pollStatusIterator ( $ finalizeResponse ) ; $ eachPromises = new Promise \ EachPromise ( $ promises , [ 'concurrency' => 1 , 'fulfilled' => function ( $ pollStatus , $ i , $ promise ) { if ( $ pollStatus != null ) { if ( ! empty ( $ pollStatus [ 'itemsDone' ] ) ) { $ promise -> resolve ( $ pollStatus [ 'itemsDone' ] ) ; } if ( ! empty ( $ pollStatus [ 'itemsFailed' ] ) ) { $ promise -> resolve ( false ) ; } } return false ; } ] ) ; return $ eachPromises -> promise ( ) ; }
Polls Bynder to confirm all chunks were uploaded and registered successfully in Bynder.

@param $finalizeResponse

@return Promise\Promise Returns whether or not the file was uploaded successfully.
@throws Exception
Polls Bynder to confirm all chunks were uploaded and registered successfully in Bynder .