@@ -108,6 +108,12 @@ |
||
| 108 | 108 | }); |
| 109 | 109 | } |
| 110 | 110 | |
| 111 | + /** |
|
| 112 | + * @param string $origin |
|
| 113 | + * @param string $fileUrl |
|
| 114 | + * @param boolean $progress |
|
| 115 | + * @param \Closure $exec |
|
| 116 | + */ |
|
| 111 | 117 | protected function fetch($origin, $fileUrl, $progress, $options, $exec) |
| 112 | 118 | { |
| 113 | 119 | do { |
@@ -64,11 +64,11 @@ discard block |
||
| 64 | 64 | * |
| 65 | 65 | * @return bool true |
| 66 | 66 | */ |
| 67 | - public function copy($origin, $fileUrl, $fileName, $progress=true, $options=array()) |
|
| 67 | + public function copy($origin, $fileUrl, $fileName, $progress = true, $options = array()) |
|
| 68 | 68 | { |
| 69 | 69 | $that = $this; // for PHP5.3 |
| 70 | 70 | |
| 71 | - return $this->fetch($origin, $fileUrl, $progress, $options, function ($ch, $request) use ($that, $fileName) { |
|
| 71 | + return $this->fetch($origin, $fileUrl, $progress, $options, function($ch, $request) use ($that, $fileName) { |
|
| 72 | 72 | $outputFile = new OutputFile($fileName); |
| 73 | 73 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, false); |
| 74 | 74 | curl_setopt($ch, CURLOPT_FILE, $outputFile->getPointer()); |
@@ -95,11 +95,11 @@ discard block |
||
| 95 | 95 | * |
| 96 | 96 | * @return bool|string The content |
| 97 | 97 | */ |
| 98 | - public function getContents($origin, $fileUrl, $progress=true, $options=array()) |
|
| 98 | + public function getContents($origin, $fileUrl, $progress = true, $options = array()) |
|
| 99 | 99 | { |
| 100 | 100 | $that = $this; // for PHP5.3 |
| 101 | 101 | |
| 102 | - return $this->fetch($origin, $fileUrl, $progress, $options, function ($ch, $request) use ($that) { |
|
| 102 | + return $this->fetch($origin, $fileUrl, $progress, $options, function($ch, $request) use ($that) { |
|
| 103 | 103 | // This order is important. |
| 104 | 104 | curl_setopt($ch, CURLOPT_FILE, STDOUT); |
| 105 | 105 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | if ($this->pluginConfig['insecure']) { |
| 158 | 158 | $opts[CURLOPT_SSL_VERIFYPEER] = false; |
| 159 | 159 | } |
| 160 | - if (! empty($pluginConfig['capath'])) { |
|
| 160 | + if (!empty($pluginConfig['capath'])) { |
|
| 161 | 161 | $opts[CURLOPT_CAPATH] = $pluginConfig['capath']; |
| 162 | 162 | } |
| 163 | 163 | |
@@ -227,9 +227,9 @@ discard block |
||
| 227 | 227 | { |
| 228 | 228 | // @codeCoverageIgnoreStart |
| 229 | 229 | if (PHP_VERSION_ID >= 50500) { |
| 230 | - list(, $downBytesMax, $downBytes, , ) = func_get_args(); |
|
| 230 | + list(, $downBytesMax, $downBytes,,) = func_get_args(); |
|
| 231 | 231 | } else { |
| 232 | - list($downBytesMax, $downBytes, , ) = func_get_args(); |
|
| 232 | + list($downBytesMax, $downBytes,,) = func_get_args(); |
|
| 233 | 233 | } |
| 234 | 234 | // @codeCoverageIgnoreEnd |
| 235 | 235 | |