| Total Complexity | 8 |
| Total Lines | 56 |
| Duplicated Lines | 0 % |
| Coverage | 50% |
| Changes | 3 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 5 | class Downloader |
||
| 6 | { |
||
| 7 | private $config; |
||
| 8 | |||
| 9 | 62 | public function __construct(Config $config) |
|
| 10 | { |
||
| 11 | 62 | $this->config = $config; |
|
| 12 | 31 | } |
|
| 13 | |||
| 14 | 60 | public function sync($type = 'xml') |
|
| 32 | } |
||
| 33 | } |
||
| 34 | } |
||
| 35 | 30 | } |
|
| 36 | |||
| 37 | public function download($url, $destination) |
||
| 38 | { |
||
| 39 | $fp = fopen($destination, 'w+'); |
||
| 40 | $ch = curl_init(); |
||
| 41 | curl_setopt_array($ch, [ |
||
| 42 | CURLOPT_URL => $url, |
||
| 43 | CURLOPT_FILE => $fp, |
||
| 44 | CURLOPT_FOLLOWLOCATION => true |
||
| 45 | ]); |
||
| 46 | curl_exec($ch); |
||
| 47 | curl_close($ch); |
||
| 48 | fclose($fp); |
||
| 49 | } |
||
| 50 | |||
| 51 | 2 | public function cleanXML($file) |
|
| 61 | 1 | } |
|
| 62 | } |
||
| 63 |