src/Vimeo/Vimeo.php
private function getTusUploadChunkSize(int $proposed_chunk_size, int $file_size): int
    {
        $proposed_chunk_size = ($proposed_chunk_size <= 0) ? 1 : $proposed_chunk_size;
        $chunks = floor($file_size / $proposed_chunk_size);
        $divides_evenly = $file_size % $proposed_chunk_size === 0;
        $number_of_chunks_proposed = ($divides_evenly) ? $chunks : $chunks + 1;

        if ($number_of_chunks_proposed > 1024) {
            return (int)floor($file_size / 1024) + 1;
        }

        return $proposed_chunk_size;
    }
private function getTusUploadChunkSize(int $proposed_chunk_size, int $file_size): int
    {
        $proposed_chunk_size = ($proposed_chunk_size <= 0) ? 1 : $proposed_chunk_size;
        $chunks = floor($file_size / $proposed_chunk_size);
        $divides_evenly = $file_size % $proposed_chunk_size === 0;
        $number_of_chunks_proposed = ($divides_evenly) ? $chunks : $chunks + 1;

        if ($number_of_chunks_proposed > 1024) {
            return (int)floor($file_size / 1024) + 1;
        }

        return $proposed_chunk_size;
    }
private function getTusUploadChunkSize ( int $ proposed_chunk_size , int $ file_size ) : int { $ proposed_chunk_size = ( $ proposed_chunk_size <= 0 ) ? 1 : $ proposed_chunk_size ; $ chunks = floor ( $ file_size / $ proposed_chunk_size ) ; $ divides_evenly = $ file_size % $ proposed_chunk_size === 0 ; $ number_of_chunks_proposed = ( $ divides_evenly ) ? $ chunks : $ chunks + 1 ; if ( $ number_of_chunks_proposed > 1024 ) { return ( int ) floor ( $ file_size / 1024 ) + 1 ; } return $ proposed_chunk_size ; }
Enforces the notion that a user may supply any `proposed_chunk_size`, as long as it results in 1024 or less
proposed chunks. In the event it does not, then the chunk size becomes the file size divided by 1024.

@param int $proposed_chunk_size
@param int $file_size
@return int
Enforces the notion that a user may supply any proposed_chunk_size as long as it results in 1024 or less proposed chunks . In the event it does not then the chunk size becomes the file size divided by 1024 .