@@ -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])) { |
@@ -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( |
@@ -197,7 +197,7 @@ discard block |
||
| 197 | 197 | $ver = curl_version(); |
| 198 | 198 | if (preg_match('/^NSS.*Basic ECC$/', $ver['ssl_version'])) { |
| 199 | 199 | $ciphers = array(); |
| 200 | - foreach (new \SplFileObject(__DIR__ . '/../res/nss_ciphers.txt') as $line) { |
|
| 200 | + foreach (new \SplFileObject(__DIR__.'/../res/nss_ciphers.txt') as $line) { |
|
| 201 | 201 | $line = trim($line); |
| 202 | 202 | if ($line) { |
| 203 | 203 | $ciphers[] = $line; |
@@ -223,7 +223,7 @@ discard block |
||
| 223 | 223 | $url .= $this->path; |
| 224 | 224 | |
| 225 | 225 | if ($this->query) { |
| 226 | - $url .= '?' . http_build_query($this->query); |
|
| 226 | + $url .= '?'.http_build_query($this->query); |
|
| 227 | 227 | } |
| 228 | 228 | |
| 229 | 229 | return $url; |
@@ -243,7 +243,7 @@ discard block |
||
| 243 | 243 | if ($ua) { |
| 244 | 244 | return $ua; |
| 245 | 245 | } |
| 246 | - $phpVersion = defined('HHVM_VERSION') ? 'HHVM ' . HHVM_VERSION : 'PHP ' . PHP_VERSION; |
|
| 246 | + $phpVersion = defined('HHVM_VERSION') ? 'HHVM '.HHVM_VERSION : 'PHP '.PHP_VERSION; |
|
| 247 | 247 | |
| 248 | 248 | return $ua = sprintf( |
| 249 | 249 | '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']) { |