_client = $client; $this->_source = $source; $this->_destination = $destination; } /** * @return string */ public function download(int $start, int $end):int { return $this->_client->_retries(function() use ($start, $end) { $response = $this->_client->getClient()->download($this->_source, $this->_destination, $start, $end); return (int) $response->Headers->{'content-length'}; }, "Failed downloading chunk"); } }