@@ -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])) { |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | unset($headers[$i]); |
| 124 | 124 | } |
| 125 | 125 | } |
| 126 | - $headers[] = 'Authorization: Basic ' . base64_encode("$this->username:$this->password"); |
|
| 126 | + $headers[] = 'Authorization: Basic '.base64_encode("$this->username:$this->password"); |
|
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | $curlOpts = $this->curlOpts + array( |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | $ver = curl_version(); |
| 158 | 158 | if (preg_match('/^NSS.*Basic ECC$/', $ver['ssl_version'])) { |
| 159 | 159 | $ciphers = array(); |
| 160 | - foreach (new \SplFileObject(__DIR__ . '/../../res/nss_ciphers.txt') as $line) { |
|
| 160 | + foreach (new \SplFileObject(__DIR__.'/../../res/nss_ciphers.txt') as $line) { |
|
| 161 | 161 | $line = trim($line); |
| 162 | 162 | if ($line) { |
| 163 | 163 | $ciphers[] = $line; |
@@ -183,7 +183,7 @@ discard block |
||
| 183 | 183 | $url .= $this->path; |
| 184 | 184 | |
| 185 | 185 | if ($this->query) { |
| 186 | - $url .= '?' . http_build_query($this->query); |
|
| 186 | + $url .= '?'.http_build_query($this->query); |
|
| 187 | 187 | } |
| 188 | 188 | |
| 189 | 189 | return $url; |
@@ -258,7 +258,7 @@ discard block |
||
| 258 | 258 | if ($ua) { |
| 259 | 259 | return $ua; |
| 260 | 260 | } |
| 261 | - $phpVersion = defined('HHVM_VERSION') ? 'HHVM ' . HHVM_VERSION : 'PHP ' . PHP_VERSION; |
|
| 261 | + $phpVersion = defined('HHVM_VERSION') ? 'HHVM '.HHVM_VERSION : 'PHP '.PHP_VERSION; |
|
| 262 | 262 | |
| 263 | 263 | return $ua = sprintf( |
| 264 | 264 | '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']) { |