@@ -26,11 +26,11 @@ |
||
| 26 | 26 | public function __construct(array $config) |
| 27 | 27 | { |
| 28 | 28 | $config += self::$default; |
| 29 | - $schema = file_get_contents(__DIR__ . '/../res/config-schema.json'); |
|
| 29 | + $schema = file_get_contents(__DIR__.'/../res/config-schema.json'); |
|
| 30 | 30 | $validator = new JsonSchema\Validator; |
| 31 | 31 | $validator->check((object)$config, json_decode($schema)); |
| 32 | 32 | |
| 33 | - if (! $validator->isValid()) { |
|
| 33 | + if (!$validator->isValid()) { |
|
| 34 | 34 | throw new \InvalidArgumentException(var_export($validator->getErrors(), true)); |
| 35 | 35 | } |
| 36 | 36 | |
@@ -60,7 +60,7 @@ |
||
| 60 | 60 | |
| 61 | 61 | // load all classes |
| 62 | 62 | foreach (self::$pluginClasses as $class) { |
| 63 | - class_exists(__NAMESPACE__ . '\\' . $class); |
|
| 63 | + class_exists(__NAMESPACE__.'\\'.$class); |
|
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | $this->config = $composer->getConfig(); |
@@ -88,6 +88,10 @@ |
||
| 88 | 88 | unset($this->curlOpts[CURLOPT_PROXYUSERPWD]); |
| 89 | 89 | } |
| 90 | 90 | |
| 91 | + /** |
|
| 92 | + * @param string $key1 |
|
| 93 | + * @param string $key2 |
|
| 94 | + */ |
|
| 91 | 95 | private static function issetOr(array $arr, $key1, $key2) |
| 92 | 96 | { |
| 93 | 97 | if (isset($arr[$key1])) { |
@@ -8,7 +8,6 @@ |
||
| 8 | 8 | |
| 9 | 9 | use Composer\Config as CConfig; |
| 10 | 10 | use Composer\IO; |
| 11 | -use Composer\Downloader; |
|
| 12 | 11 | use Composer\Util; |
| 13 | 12 | |
| 14 | 13 | /** |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | unset($headers[$i]); |
| 164 | 164 | } |
| 165 | 165 | } |
| 166 | - $headers[] = 'Authorization: Basic ' . base64_encode("$this->username:$this->password"); |
|
| 166 | + $headers[] = 'Authorization: Basic '.base64_encode("$this->username:$this->password"); |
|
| 167 | 167 | } |
| 168 | 168 | |
| 169 | 169 | $curlOpts = $this->curlOpts + array( |
@@ -196,7 +196,7 @@ discard block |
||
| 196 | 196 | } |
| 197 | 197 | $ver = curl_version(); |
| 198 | 198 | if (preg_match('/^NSS.*Basic ECC$/', $ver['ssl_version'])) { |
| 199 | - $ciphers = file(__DIR__ . '/../res/nss_ciphers.txt', \FILE_IGNORE_NEW_LINES | \FILE_SKIP_EMPTY_LINES); |
|
| 199 | + $ciphers = file(__DIR__.'/../res/nss_ciphers.txt', \FILE_IGNORE_NEW_LINES | \FILE_SKIP_EMPTY_LINES); |
|
| 200 | 200 | return $cache = implode(',', $ciphers); |
| 201 | 201 | } |
| 202 | 202 | return $cache = false; |
@@ -217,7 +217,7 @@ discard block |
||
| 217 | 217 | $url .= $this->path; |
| 218 | 218 | |
| 219 | 219 | if ($this->query) { |
| 220 | - $url .= '?' . http_build_query($this->query); |
|
| 220 | + $url .= '?'.http_build_query($this->query); |
|
| 221 | 221 | } |
| 222 | 222 | |
| 223 | 223 | return $url; |
@@ -237,7 +237,7 @@ discard block |
||
| 237 | 237 | if ($ua) { |
| 238 | 238 | return $ua; |
| 239 | 239 | } |
| 240 | - $phpVersion = defined('HHVM_VERSION') ? 'HHVM ' . HHVM_VERSION : 'PHP ' . PHP_VERSION; |
|
| 240 | + $phpVersion = defined('HHVM_VERSION') ? 'HHVM '.HHVM_VERSION : 'PHP '.PHP_VERSION; |
|
| 241 | 241 | |
| 242 | 242 | return $ua = sprintf( |
| 243 | 243 | 'Composer/%s (%s; %s; %s)', |
@@ -20,7 +20,7 @@ |
||
| 20 | 20 | { |
| 21 | 21 | parent::__construct($origin, $url, $io); |
| 22 | 22 | if ($this->password === 'oauth2') { |
| 23 | - $this->headers[] = 'Authorization: Bearer ' . $this->username; |
|
| 23 | + $this->headers[] = 'Authorization: Bearer '.$this->username; |
|
| 24 | 24 | // forbid basic-auth |
| 25 | 25 | $this->username = $this->password = null; |
| 26 | 26 | } |
@@ -29,7 +29,7 @@ |
||
| 29 | 29 | if (substr($origin, -10) === 'github.com') { |
| 30 | 30 | $origin = 'github.com'; |
| 31 | 31 | } |
| 32 | - $requestClass = __NAMESPACE__ . '\\' . self::getRequestClass($origin, $config) . 'Request'; |
|
| 32 | + $requestClass = __NAMESPACE__.'\\'.self::getRequestClass($origin, $config).'Request'; |
|
| 33 | 33 | $request = new $requestClass($origin, $url, $io); |
| 34 | 34 | $request->verbose = $pluginConfig['verbose']; |
| 35 | 35 | if ($pluginConfig['insecure']) { |