Completed
Push — master ( 1e7bfa...d3403d )
by Hiraku
17:08
created
src/ParallelDownloader.php 1 patch
Braces   +15 added lines, -8 removed lines patch added patch discarded remove patch
@@ -110,24 +110,31 @@
 block discarded – undo
110 110
             }
111 111
 
112 112
             // start multi download
113
-            do $stat = curl_multi_exec($mh, $running);
114
-            while ($stat === CURLM_CALL_MULTI_PERFORM);
113
+            do {
114
+                $stat = curl_multi_exec($mh, $running);
115
+            } while ($stat === CURLM_CALL_MULTI_PERFORM);
115 116
 
116 117
             // wait for any event
117
-            do switch (curl_multi_select($mh, 5)) {
118
+            do {
119
+                switch (curl_multi_select($mh, 5)) {
118 120
                 case -1:
119 121
                     usleep(10);
120
-                    do $stat = curl_multi_exec($mh, $running);
121
-                    while ($stat === CURLM_CALL_MULTI_PERFORM);
122
+            }
123
+                    do {
124
+                        $stat = curl_multi_exec($mh, $running);
125
+                    } while ($stat === CURLM_CALL_MULTI_PERFORM);
122 126
                     continue 2;
123 127
                 case 0:
124 128
                     continue 2;
125 129
                 default:
126
-                    do $stat = curl_multi_exec($mh, $running);
127
-                    while ($stat === CURLM_CALL_MULTI_PERFORM);
130
+                    do {
131
+                        $stat = curl_multi_exec($mh, $running);
132
+                    } while ($stat === CURLM_CALL_MULTI_PERFORM);
128 133
 
129
-                    do if ($raised = curl_multi_info_read($mh, $remains)) {
134
+                    do {
135
+                        if ($raised = curl_multi_info_read($mh, $remains)) {
130 136
                         $ch = $raised['handle'];
137
+                    }
131 138
                         $errno = curl_errno($ch);
132 139
                         $info = curl_getinfo($ch);
133 140
                         curl_setopt($ch, CURLOPT_FILE, STDOUT);
Please login to merge, or discard this patch.
src/Aspects/HttpGetRequest.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -63,7 +63,9 @@  discard block
 block discarded – undo
63 63
     public function importURL($url)
64 64
     {
65 65
         $struct = parse_url($url);
66
-        if (! $struct) throw new \InvalidArgumentException("$url is not valid URL");
66
+        if (! $struct) {
67
+            throw new \InvalidArgumentException("$url is not valid URL");
68
+        }
67 69
 
68 70
         $this->scheme = self::setOr($struct, 'scheme', $this->scheme);
69 71
         $this->host = self::setOr($struct, 'host', $this->host);
@@ -149,7 +151,9 @@  discard block
 block discarded – undo
149 151
 
150 152
     public static function genUA() {
151 153
         static $ua;
152
-        if ($ua) return $ua;
154
+        if ($ua) {
155
+            return $ua;
156
+        }
153 157
         $phpVersion = defined('HHVM_VERSION') ? 'HHVM ' . HHVM_VERSION : 'PHP ' . PHP_VERSION;
154 158
 
155 159
         return $ua = sprintf(
Please login to merge, or discard this patch.