@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | |
| 97 | 97 | foreach (array('https', 'http') as $scheme) { |
| 98 | 98 | if ($this->scheme === $scheme) { |
| 99 | - $label = $scheme . '_proxy'; |
|
| 99 | + $label = $scheme.'_proxy'; |
|
| 100 | 100 | foreach (array(strtoupper($label), $label) as $l) { |
| 101 | 101 | if (isset($_SERVER[$l])) { |
| 102 | 102 | return $_SERVER[$l]; |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | if ($useRedirector) { |
| 121 | 121 | if ($this->host === 'api.github.com' && preg_match('%^/repos(/[^/]+/[^/]+/)zipball(.+)$%', $this->path, $_)) { |
| 122 | 122 | $this->host = 'codeload.github.com'; |
| 123 | - $this->path = $_[1] . 'legacy.zip' . $_[2]; |
|
| 123 | + $this->path = $_[1].'legacy.zip'.$_[2]; |
|
| 124 | 124 | } |
| 125 | 125 | } |
| 126 | 126 | } else { |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | } |
| 145 | 145 | // is gitlab |
| 146 | 146 | if (in_array($authKey, $gitlabDomains) && 'oauth2' === $auth['password']) { |
| 147 | - $this->addHeader('authorization', 'Bearer ' . $auth['username']); |
|
| 147 | + $this->addHeader('authorization', 'Bearer '.$auth['username']); |
|
| 148 | 148 | $this->user = $this->pass = null; |
| 149 | 149 | return; |
| 150 | 150 | } |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | { |
| 161 | 161 | $headers = array(); |
| 162 | 162 | foreach ($this->headers as $key => $val) { |
| 163 | - $headers[] = strtr(ucwords(strtr($key, '-', ' ')), ' ', '-') . ': ' . $val; |
|
| 163 | + $headers[] = strtr(ucwords(strtr($key, '-', ' ')), ' ', '-').': '.$val; |
|
| 164 | 164 | } |
| 165 | 165 | |
| 166 | 166 | $url = $this->getURL(); |
@@ -200,7 +200,7 @@ discard block |
||
| 200 | 200 | if ($this->user) { |
| 201 | 201 | $user = $this->user; |
| 202 | 202 | $user .= self::ifOr($this->pass, ':'); |
| 203 | - $url .= $user . '@'; |
|
| 203 | + $url .= $user.'@'; |
|
| 204 | 204 | } |
| 205 | 205 | $url .= self::ifOr($this->host); |
| 206 | 206 | $url .= self::ifOr($this->port, ':'); |
@@ -235,7 +235,7 @@ discard block |
||
| 235 | 235 | private static function ifOr($str, $pre = '', $post = '') |
| 236 | 236 | { |
| 237 | 237 | if ($str) { |
| 238 | - return $pre . $str . $post; |
|
| 238 | + return $pre.$str.$post; |
|
| 239 | 239 | } |
| 240 | 240 | return ''; |
| 241 | 241 | } |
@@ -10,10 +10,7 @@ |
||
| 10 | 10 | use Composer\IO; |
| 11 | 11 | use Composer\Plugin as CPlugin; |
| 12 | 12 | use Composer\EventDispatcher; |
| 13 | -use Composer\Package; |
|
| 14 | -use Composer\Script; |
|
| 15 | 13 | use Composer\Installer; |
| 16 | -use Composer\DependencyResolver; |
|
| 17 | 14 | |
| 18 | 15 | class Plugin implements |
| 19 | 16 | CPlugin\PluginInterface, |
@@ -17,12 +17,12 @@ |
||
| 17 | 17 | |
| 18 | 18 | $requests = array(); |
| 19 | 19 | $cachedir = $this->config->get('cache-repo-dir'); |
| 20 | - $cacheBase = $cachedir . DIRECTORY_SEPARATOR . strtr($this->baseUrl, ':/', '--'); |
|
| 20 | + $cacheBase = $cachedir.DIRECTORY_SEPARATOR.strtr($this->baseUrl, ':/', '--'); |
|
| 21 | 21 | foreach ($includes as $include => $metadata) { |
| 22 | - $url = $this->baseUrl . '/' . str_replace('%hash%', $metadata['sha256'], $include); |
|
| 23 | - $cacheKey = str_replace(array('%hash%','$'), '', $include); |
|
| 22 | + $url = $this->baseUrl.'/'.str_replace('%hash%', $metadata['sha256'], $include); |
|
| 23 | + $cacheKey = str_replace(array('%hash%', '$'), '', $include); |
|
| 24 | 24 | if ($this->cache->sha256($cacheKey) !== $metadata['sha256']) { |
| 25 | - $dest = $cacheBase . DIRECTORY_SEPARATOR . str_replace('/', '-', $cacheKey); |
|
| 25 | + $dest = $cacheBase.DIRECTORY_SEPARATOR.str_replace('/', '-', $cacheKey); |
|
| 26 | 26 | $requests[] = new CopyRequest($url, $dest, false, $this->io, $this->config); |
| 27 | 27 | } |
| 28 | 28 | } |