Completed
Push — master ( e84ecd...b63790 )
by Hiraku
04:17
created
src/Aspects/HttpGetRequest.php 1 patch
Doc Comments   +8 added lines patch added patch discarded remove patch
@@ -60,6 +60,9 @@  discard block
 block discarded – undo
60 60
         }
61 61
     }
62 62
 
63
+    /**
64
+     * @param string $url
65
+     */
63 66
     public function importURL($url)
64 67
     {
65 68
         $struct = parse_url($url);
@@ -78,6 +81,11 @@  discard block
 block discarded – undo
78 81
     }
79 82
 
80 83
     // utility for __construct
84
+
85
+    /**
86
+     * @param string $key
87
+     * @param string $default
88
+     */
81 89
     private static function setOr(array $struct, $key, $default=null)
82 90
     {
83 91
         if (!empty($struct[$key])) {
Please login to merge, or discard this patch.
src/CurlRemoteFilesystem.php 1 patch
Doc Comments   +9 added lines, -1 removed lines patch added patch discarded remove patch
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
     /**
80 80
      * Get the content.
81 81
      *
82
-     * @param string $originUrl The origin URL
82
+     * @param string $origin The origin URL
83 83
      * @param string $fileUrl   The file URL
84 84
      * @param bool   $progress  Display the progression
85 85
      * @param array  $options   Additional context options
@@ -97,6 +97,11 @@  discard block
 block discarded – undo
97 97
         });
98 98
     }
99 99
 
100
+    /**
101
+     * @param string $fileUrl
102
+     * @param boolean $progress
103
+     * @param \Closure $exec
104
+     */
100 105
     protected function fetch($origin, $fileUrl, $progress, $options, $exec)
101 106
     {
102 107
         do {
@@ -216,6 +221,9 @@  discard block
 block discarded – undo
216 221
         return 0;
217 222
     }
218 223
 
224
+    /**
225
+     * @param string $fileName
226
+     */
219 227
     public static function createFile($fileName)
220 228
     {
221 229
         if (is_dir($fileName)) {
Please login to merge, or discard this patch.
src/ParallelDownloader.php 1 patch
Switch Indentation   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -116,46 +116,46 @@
 block discarded – undo
116 116
             // wait for any event
117 117
             do {
118 118
                 switch (curl_multi_select($mh, 5)) {
119
-                case -1:
120
-                    usleep(10);
121
-                    do {
122
-                        $stat = curl_multi_exec($mh, $running);
123
-                    } while ($stat === CURLM_CALL_MULTI_PERFORM);
124
-                    continue 2;
125
-                case 0:
126
-                    continue 2;
127
-                default:
128
-                    do {
129
-                        $stat = curl_multi_exec($mh, $running);
130
-                    } while ($stat === CURLM_CALL_MULTI_PERFORM);
131
-
132
-                    do {
133
-                        if ($raised = curl_multi_info_read($mh, $remains)) {
134
-                            $ch = $raised['handle'];
135
-                            $errno = curl_errno($ch);
136
-                            $info = curl_getinfo($ch);
137
-                            curl_setopt($ch, CURLOPT_FILE, STDOUT);
138
-                            $index = (int)$ch;
139
-                            $fileinfo = $chFpMap[$index];
140
-                            unset($chFpMap[$index]);
141
-                            $fp = $fileinfo['fp'];
142
-                            $filepath = $fileinfo['filepath'];
143
-                            fclose($fp);
144
-                            if (CURLE_OK === $errno && 200 === $info['http_code']) {
145
-                                ++$this->successCnt;
146
-                            } else {
147
-                                ++$this->failureCnt;
148
-                                unlink($filepath);
119
+                    case -1:
120
+                        usleep(10);
121
+                        do {
122
+                            $stat = curl_multi_exec($mh, $running);
123
+                        } while ($stat === CURLM_CALL_MULTI_PERFORM);
124
+                        continue 2;
125
+                    case 0:
126
+                        continue 2;
127
+                    default:
128
+                        do {
129
+                            $stat = curl_multi_exec($mh, $running);
130
+                        } while ($stat === CURLM_CALL_MULTI_PERFORM);
131
+
132
+                        do {
133
+                            if ($raised = curl_multi_info_read($mh, $remains)) {
134
+                                $ch = $raised['handle'];
135
+                                $errno = curl_errno($ch);
136
+                                $info = curl_getinfo($ch);
137
+                                curl_setopt($ch, CURLOPT_FILE, STDOUT);
138
+                                $index = (int)$ch;
139
+                                $fileinfo = $chFpMap[$index];
140
+                                unset($chFpMap[$index]);
141
+                                $fp = $fileinfo['fp'];
142
+                                $filepath = $fileinfo['filepath'];
143
+                                fclose($fp);
144
+                                if (CURLE_OK === $errno && 200 === $info['http_code']) {
145
+                                    ++$this->successCnt;
146
+                                } else {
147
+                                    ++$this->failureCnt;
148
+                                    unlink($filepath);
149
+                                }
150
+                                $this->io->write($this->makeDownloadingText($info['url']));
151
+                                curl_multi_remove_handle($mh, $ch);
152
+                                $unused[] = $ch;
149 153
                             }
150
-                            $this->io->write($this->makeDownloadingText($info['url']));
151
-                            curl_multi_remove_handle($mh, $ch);
152
-                            $unused[] = $ch;
153
-                        }
154
-                    } while ($remains);
154
+                        } while ($remains);
155 155
 
156
-                    if ($packages) {
157
-                        break 2;
158
-                    }
156
+                        if ($packages) {
157
+                            break 2;
158
+                        }
159 159
             }
160 160
             } while ($running);
161 161
         } while ($packages);
Please login to merge, or discard this patch.