@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | /** |
27 | 27 | * get cached curl handler |
28 | 28 | * @param string $origin |
29 | - * @return resource<curl> |
|
29 | + * @return resource |
|
30 | 30 | */ |
31 | 31 | public static function getConnection($origin) |
32 | 32 | { |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | |
68 | 68 | /** |
69 | 69 | * @param string $origin |
70 | - * @param Composer\Config $config |
|
70 | + * @param CConfig $config |
|
71 | 71 | * @return string |
72 | 72 | */ |
73 | 73 | private static function getRequestClass($origin, CConfig $config) |
@@ -50,7 +50,7 @@ |
||
50 | 50 | if (substr($origin, -10) === 'github.com') { |
51 | 51 | $origin = 'github.com'; |
52 | 52 | } |
53 | - $requestClass = __NAMESPACE__ . '\Aspects\\' . self::getRequestClass($origin, $config) . 'Request'; |
|
53 | + $requestClass = __NAMESPACE__.'\Aspects\\'.self::getRequestClass($origin, $config).'Request'; |
|
54 | 54 | $request = new $requestClass($origin, $url, $io); |
55 | 55 | $request->verbose = $pluginConfig['verbose']; |
56 | 56 | if ($pluginConfig['insecure']) { |
@@ -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 |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | { |
68 | 68 | $that = $this; // for PHP5.3 |
69 | 69 | |
70 | - return $this->fetch($origin, $fileUrl, $progress, $options, function ($ch, $request) use ($that, $fileName) { |
|
70 | + return $this->fetch($origin, $fileUrl, $progress, $options, function($ch, $request) use ($that, $fileName) { |
|
71 | 71 | $outputFile = new OutputFile($fileName); |
72 | 72 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, false); |
73 | 73 | curl_setopt($ch, CURLOPT_FILE, $outputFile->getPointer()); |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | { |
99 | 99 | $that = $this; // for PHP5.3 |
100 | 100 | |
101 | - return $this->fetch($origin, $fileUrl, $progress, $options, function ($ch, $request) use ($that) { |
|
101 | + return $this->fetch($origin, $fileUrl, $progress, $options, function($ch, $request) use ($that) { |
|
102 | 102 | // This order is important. |
103 | 103 | curl_setopt($ch, CURLOPT_FILE, STDOUT); |
104 | 104 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | $request->processRFSOption($options); |
127 | 127 | |
128 | 128 | if ($this->io->isDebug()) { |
129 | - $this->io->write('Downloading ' . $fileUrl); |
|
129 | + $this->io->write('Downloading '.$fileUrl); |
|
130 | 130 | } |
131 | 131 | |
132 | 132 | if ($progress) { |
@@ -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(); |
@@ -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 | } |