Completed
Pull Request — master (#176)
by Markus
01:46
created
src/BaseRequest.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 
101 101
         foreach (array('https', 'http') as $scheme) {
102 102
             if ($this->scheme === $scheme) {
103
-                $label = $scheme . '_proxy';
103
+                $label = $scheme.'_proxy';
104 104
                 foreach (array(strtoupper($label), $label) as $l) {
105 105
                     if (isset($_SERVER[$l])) {
106 106
                         return $_SERVER[$l];
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
             if ($useRedirector) {
125 125
                 if ($this->host === 'api.github.com' && preg_match('%^/repos(/[^/]+/[^/]+/)zipball(.+)$%', $this->path, $_)) {
126 126
                     $this->host = 'codeload.github.com';
127
-                    $this->path = $_[1] . 'legacy.zip' . $_[2];
127
+                    $this->path = $_[1].'legacy.zip'.$_[2];
128 128
                 }
129 129
             }
130 130
         } else {
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
         // is gitlab
150 150
         if (in_array($authKey, $gitlabDomains)) {
151 151
             if ('oauth2' === $auth['password']) {
152
-                $this->addHeader('authorization', 'Bearer ' . $auth['username']);
152
+                $this->addHeader('authorization', 'Bearer '.$auth['username']);
153 153
                 $this->user = $this->pass = null;
154 154
                 return;
155 155
             }
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
     {
173 173
         $headers = array();
174 174
         foreach ($this->headers as $key => $val) {
175
-            $headers[] = strtr(ucwords(strtr($key, '-', ' ')), ' ', '-') . ': ' . $val;
175
+            $headers[] = strtr(ucwords(strtr($key, '-', ' ')), ' ', '-').': '.$val;
176 176
         }
177 177
 
178 178
         $url = $this->getURL();
@@ -205,9 +205,9 @@  discard block
 block discarded – undo
205 205
             "packagist.org",
206 206
             "repo.packagist.org"
207 207
         );
208
-        foreach($hostsWhichSupportHttp2 as $http2Host) {
208
+        foreach ($hostsWhichSupportHttp2 as $http2Host) {
209 209
             // http2 requires https
210
-            if (preg_match('{^https://'. preg_quote($http2Host) .'}i', $url)) {
210
+            if (preg_match('{^https://'.preg_quote($http2Host).'}i', $url)) {
211 211
                 $h2ServerSupported = true;
212 212
                 break;
213 213
             }
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
         // e.g. codeload.github.com does not yet support http2 though :-/
218 218
         $h2ClientSupported = curl_version()["features"] & CURL_VERSION_HTTP2 !== 0;
219 219
 
220
-        var_dump("checking url..". $url);
220
+        var_dump("checking url..".$url);
221 221
         if ($h2ClientSupported) {
222 222
             var_dump("client supports http2\n");
223 223
         }
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
         if ($this->user) {
244 244
             $user = $this->user;
245 245
             $user .= self::ifOr($this->pass, ':');
246
-            $url .= $user . '@';
246
+            $url .= $user.'@';
247 247
         }
248 248
         $url .= self::ifOr($this->host);
249 249
         $url .= self::ifOr($this->port, ':');
@@ -278,7 +278,7 @@  discard block
 block discarded – undo
278 278
     private static function ifOr($str, $pre = '', $post = '')
279 279
     {
280 280
         if ($str) {
281
-            return $pre . $str . $post;
281
+            return $pre.$str.$post;
282 282
         }
283 283
         return '';
284 284
     }
Please login to merge, or discard this patch.