@@ -215,6 +215,10 @@ |
||
| 215 | 215 | } |
| 216 | 216 | } |
| 217 | 217 | |
| 218 | + /** |
|
| 219 | + * @param string $dir |
|
| 220 | + * @param string $baseinstalldir |
|
| 221 | + */ |
|
| 218 | 222 | public function buildSubPackage($dir, $baseinstalldir, $info) |
| 219 | 223 | { |
| 220 | 224 | $package = str_replace('/', '_', $baseinstalldir); |
@@ -58,12 +58,12 @@ discard block |
||
| 58 | 58 | { |
| 59 | 59 | $this->basedir = $this->getProject()->getBasedir(); |
| 60 | 60 | |
| 61 | - if (!is_dir((string) $this->basedir.'/.subsplit')) { |
|
| 61 | + if (!is_dir((string) $this->basedir . '/.subsplit')) { |
|
| 62 | 62 | throw new BuildException('PEAR packaging requires .subsplit directory'); |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | // main composer file |
| 66 | - $composer_file = file_get_contents((string) $this->basedir.'/.subsplit/composer.json'); |
|
| 66 | + $composer_file = file_get_contents((string) $this->basedir . '/.subsplit/composer.json'); |
|
| 67 | 67 | $this->guzzleinfo = json_decode($composer_file, true); |
| 68 | 68 | |
| 69 | 69 | // make sure we have a target |
@@ -188,14 +188,14 @@ discard block |
||
| 188 | 188 | // load up package file and build package |
| 189 | 189 | $packager = new PEAR_Packager(); |
| 190 | 190 | echo "\n\n\nBUILDING PACKAGE FROM PACKAGE FILE:\n"; |
| 191 | - $dest_package = $packager->package($opts['packagedirectory'].'package.xml'); |
|
| 191 | + $dest_package = $packager->package($opts['packagedirectory'] . 'package.xml'); |
|
| 192 | 192 | var_dump($dest_package); |
| 193 | 193 | } else { |
| 194 | 194 | echo "\n\n\nDEBUGGING RESULT:\n"; |
| 195 | 195 | var_dump($result); |
| 196 | 196 | } |
| 197 | 197 | echo "removing package.xml"; |
| 198 | - unlink($opts['packagedirectory'].'package.xml'); |
|
| 198 | + unlink($opts['packagedirectory'] . 'package.xml'); |
|
| 199 | 199 | $log = ob_get_clean(); |
| 200 | 200 | file_put_contents((string) $this->basedir . '/build/artifacts/logs/pear_package.log', $log); |
| 201 | 201 | chdir($startdir); |
@@ -207,8 +207,8 @@ discard block |
||
| 207 | 207 | |
| 208 | 208 | foreach ($this->subpackages as $package) { |
| 209 | 209 | $baseinstalldir = dirname($package); |
| 210 | - $dir = (string) $this->basedir.'/.subsplit/src/' . $baseinstalldir; |
|
| 211 | - $composer_file = file_get_contents((string) $this->basedir.'/.subsplit/src/'. $package); |
|
| 210 | + $dir = (string) $this->basedir . '/.subsplit/src/' . $baseinstalldir; |
|
| 211 | + $composer_file = file_get_contents((string) $this->basedir . '/.subsplit/src/' . $package); |
|
| 212 | 212 | $package_info = json_decode($composer_file, true); |
| 213 | 213 | $this->log('building ' . $package_info['target-dir'] . ' subpackage'); |
| 214 | 214 | $this->buildSubPackage($dir, $baseinstalldir, $package_info); |
@@ -282,23 +282,23 @@ discard block |
||
| 282 | 282 | // load up package file and build package |
| 283 | 283 | $packager = new PEAR_Packager(); |
| 284 | 284 | echo "\n\n\nBUILDING PACKAGE FROM PACKAGE FILE:\n"; |
| 285 | - $dest_package = $packager->package($opts['packagedirectory'].'/package.xml'); |
|
| 285 | + $dest_package = $packager->package($opts['packagedirectory'] . '/package.xml'); |
|
| 286 | 286 | var_dump($dest_package); |
| 287 | 287 | } else { |
| 288 | 288 | echo "\n\n\nDEBUGGING RESULT:\n"; |
| 289 | 289 | var_dump($result); |
| 290 | 290 | } |
| 291 | 291 | echo "removing package.xml"; |
| 292 | - unlink($opts['packagedirectory'].'/package.xml'); |
|
| 292 | + unlink($opts['packagedirectory'] . '/package.xml'); |
|
| 293 | 293 | $log = ob_get_clean(); |
| 294 | - file_put_contents((string) $this->basedir . '/build/artifacts/logs/pear_package_'.$package.'.log', $log); |
|
| 294 | + file_put_contents((string) $this->basedir . '/build/artifacts/logs/pear_package_' . $package . '.log', $log); |
|
| 295 | 295 | chdir($startdir); |
| 296 | 296 | } |
| 297 | 297 | |
| 298 | 298 | public function findComponents() |
| 299 | 299 | { |
| 300 | 300 | $ds = new DirectoryScanner(); |
| 301 | - $ds->setBasedir((string) $this->basedir.'/.subsplit/src'); |
|
| 301 | + $ds->setBasedir((string) $this->basedir . '/.subsplit/src'); |
|
| 302 | 302 | $ds->setIncludes(array('**/composer.json')); |
| 303 | 303 | $ds->scan(); |
| 304 | 304 | $files = $ds->getIncludedFiles(); |
@@ -307,14 +307,14 @@ discard block |
||
| 307 | 307 | |
| 308 | 308 | public function grabChangelog() |
| 309 | 309 | { |
| 310 | - $cl = file((string) $this->basedir.'/.subsplit/CHANGELOG.md'); |
|
| 310 | + $cl = file((string) $this->basedir . '/.subsplit/CHANGELOG.md'); |
|
| 311 | 311 | $notes = ''; |
| 312 | 312 | $in_version = false; |
| 313 | 313 | $release_date = null; |
| 314 | 314 | |
| 315 | 315 | foreach ($cl as $line) { |
| 316 | 316 | $line = trim($line); |
| 317 | - if (preg_match('/^\* '.$this->getVersion().' \(([0-9\-]+)\)$/', $line, $matches)) { |
|
| 317 | + if (preg_match('/^\* ' . $this->getVersion() . ' \(([0-9\-]+)\)$/', $line, $matches)) { |
|
| 318 | 318 | $release_date = $matches[1]; |
| 319 | 319 | $in_version = true; |
| 320 | 320 | continue; |
@@ -322,8 +322,8 @@ discard block |
||
| 322 | 322 | if ($in_version && empty($line) && empty($notes)) { |
| 323 | 323 | continue; |
| 324 | 324 | } |
| 325 | - if ($in_version && ! empty($line)) { |
|
| 326 | - $notes .= $line."\n"; |
|
| 325 | + if ($in_version && !empty($line)) { |
|
| 326 | + $notes .= $line . "\n"; |
|
| 327 | 327 | } |
| 328 | 328 | if ($in_version && empty($line) && !empty($notes)) { |
| 329 | 329 | $in_version = false; |
@@ -331,7 +331,7 @@ discard block |
||
| 331 | 331 | } |
| 332 | 332 | $this->changelog_release_date = $release_date; |
| 333 | 333 | |
| 334 | - if (! empty($notes)) { |
|
| 334 | + if (!empty($notes)) { |
|
| 335 | 335 | $this->changelog_notes = $notes; |
| 336 | 336 | } |
| 337 | 337 | } |
@@ -94,6 +94,9 @@ |
||
| 94 | 94 | $this->base = $str; |
| 95 | 95 | } |
| 96 | 96 | |
| 97 | + /** |
|
| 98 | + * @return string |
|
| 99 | + */ |
|
| 97 | 100 | public function getBase() |
| 98 | 101 | { |
| 99 | 102 | return $this->base; |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | /** |
| 143 | 143 | * GitClient from VersionControl_Git |
| 144 | 144 | */ |
| 145 | - protected $client = null; |
|
| 145 | + protected $client = null; |
|
| 146 | 146 | |
| 147 | 147 | /** |
| 148 | 148 | * The main entry point |
@@ -192,7 +192,7 @@ discard block |
||
| 192 | 192 | $heads = $this->getHeads(); |
| 193 | 193 | foreach ($heads as $head) { |
| 194 | 194 | foreach ($this->splits[$head] as $component => $meta) { |
| 195 | - $splits[] = $base . $component . ':[email protected]:'. $org.'/'.$meta['repo']; |
|
| 195 | + $splits[] = $base . $component . ':[email protected]:' . $org . '/' . $meta['repo']; |
|
| 196 | 196 | } |
| 197 | 197 | |
| 198 | 198 | $cmd = 'git subsplit publish '; |
@@ -201,7 +201,7 @@ discard block |
||
| 201 | 201 | if ($this->getNoHeads()) { |
| 202 | 202 | $cmd .= ' --no-heads'; |
| 203 | 203 | } else { |
| 204 | - $cmd .= ' --heads='.$head; |
|
| 204 | + $cmd .= ' --heads=' . $head; |
|
| 205 | 205 | } |
| 206 | 206 | |
| 207 | 207 | if ($this->getNoTags()) { |
@@ -228,7 +228,7 @@ discard block |
||
| 228 | 228 | try { |
| 229 | 229 | $cmd->execute(); |
| 230 | 230 | } catch (Exception $e) { |
| 231 | - throw new BuildException('git subsplit update failed'. $e); |
|
| 231 | + throw new BuildException('git subsplit update failed' . $e); |
|
| 232 | 232 | } |
| 233 | 233 | chdir($repo . '/.subsplit'); |
| 234 | 234 | passthru('php ../composer.phar update --dev'); |
@@ -252,7 +252,7 @@ discard block |
||
| 252 | 252 | try { |
| 253 | 253 | $output = $cmd->execute(); |
| 254 | 254 | } catch (Exception $e) { |
| 255 | - throw new BuildException('git subsplit init failed'. $e); |
|
| 255 | + throw new BuildException('git subsplit init failed' . $e); |
|
| 256 | 256 | } |
| 257 | 257 | $this->log(trim($output), Project::MSG_INFO); |
| 258 | 258 | $repo = $this->getRepository(); |
@@ -289,13 +289,13 @@ discard block |
||
| 289 | 289 | passthru("git checkout '$head'"); |
| 290 | 290 | $ds = new DirectoryScanner(); |
| 291 | 291 | $ds->setBasedir($repo . '/.subsplit' . $base); |
| 292 | - $ds->setIncludes(array('**/'.$this->subIndicatorFile)); |
|
| 292 | + $ds->setIncludes(array('**/' . $this->subIndicatorFile)); |
|
| 293 | 293 | $ds->scan(); |
| 294 | 294 | $files = $ds->getIncludedFiles(); |
| 295 | 295 | |
| 296 | 296 | // Process the files we found |
| 297 | 297 | foreach ($files as $file) { |
| 298 | - $pkg = file_get_contents($repo . '/.subsplit' . $base .'/'. $file); |
|
| 298 | + $pkg = file_get_contents($repo . '/.subsplit' . $base . '/' . $file); |
|
| 299 | 299 | $pkg_json = json_decode($pkg, true); |
| 300 | 300 | $name = $pkg_json['name']; |
| 301 | 301 | $component = str_replace('/composer.json', '', $file); |
@@ -330,7 +330,7 @@ discard block |
||
| 330 | 330 | return; |
| 331 | 331 | } |
| 332 | 332 | |
| 333 | - $ch = curl_init('https://api.github.com/orgs/'.$github_org.'/repos?type=all'); |
|
| 333 | + $ch = curl_init('https://api.github.com/orgs/' . $github_org . '/repos?type=all'); |
|
| 334 | 334 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); |
| 335 | 335 | curl_setopt($ch, CURLOPT_USERPWD, $github_creds); |
| 336 | 336 | // change this when we know we can use our bundled CA bundle! |
@@ -365,7 +365,7 @@ discard block |
||
| 365 | 365 | 'has_downloads' => true, |
| 366 | 366 | 'auto_init' => false |
| 367 | 367 | ); |
| 368 | - $ch = curl_init('https://api.github.com/orgs/'.$github_org.'/repos'); |
|
| 368 | + $ch = curl_init('https://api.github.com/orgs/' . $github_org . '/repos'); |
|
| 369 | 369 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); |
| 370 | 370 | curl_setopt($ch, CURLOPT_USERPWD, $github_creds); |
| 371 | 371 | curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json')); |
@@ -374,7 +374,7 @@ discard block |
||
| 374 | 374 | // change this when we know we can use our bundled CA bundle! |
| 375 | 375 | curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); |
| 376 | 376 | $result = curl_exec($ch); |
| 377 | - echo "Response code: ".curl_getinfo($ch, CURLINFO_HTTP_CODE)."\n"; |
|
| 377 | + echo "Response code: " . curl_getinfo($ch, CURLINFO_HTTP_CODE) . "\n"; |
|
| 378 | 378 | curl_close($ch); |
| 379 | 379 | } else { |
| 380 | 380 | $this->log("Repo $reponame exists", 2); |
@@ -52,7 +52,7 @@ |
||
| 52 | 52 | /** |
| 53 | 53 | * Trace the decorators associated with the batch |
| 54 | 54 | * |
| 55 | - * @return array |
|
| 55 | + * @return AbstractBatchDecorator[] |
|
| 56 | 56 | */ |
| 57 | 57 | public function getDecorators() |
| 58 | 58 | { |
@@ -47,7 +47,7 @@ |
||
| 47 | 47 | /** |
| 48 | 48 | * Automatically flush the batch when the size of the queue reaches a certain threshold. Adds {@see FlushingBatch}. |
| 49 | 49 | * |
| 50 | - * @param $threshold Number of items to allow in the queue before a flush |
|
| 50 | + * @param integer $threshold Number of items to allow in the queue before a flush |
|
| 51 | 51 | * |
| 52 | 52 | * @return BatchBuilder |
| 53 | 53 | */ |
@@ -26,7 +26,7 @@ |
||
| 26 | 26 | * |
| 27 | 27 | * @param array $config Configuration values to apply. |
| 28 | 28 | * @param array $defaults Default parameters |
| 29 | - * @param array $required Required parameter names |
|
| 29 | + * @param string[] $required Required parameter names |
|
| 30 | 30 | * |
| 31 | 31 | * @return self |
| 32 | 32 | * @throws InvalidArgumentException if a parameter is missing |
@@ -322,7 +322,7 @@ discard block |
||
| 322 | 322 | */ |
| 323 | 323 | public function setPath($path, $value) |
| 324 | 324 | { |
| 325 | - $current =& $this->data; |
|
| 325 | + $current = & $this->data; |
|
| 326 | 326 | $queue = explode('/', $path); |
| 327 | 327 | while (null !== ($key = array_shift($queue))) { |
| 328 | 328 | if (!is_array($current)) { |
@@ -330,10 +330,10 @@ discard block |
||
| 330 | 330 | } elseif (!$queue) { |
| 331 | 331 | $current[$key] = $value; |
| 332 | 332 | } elseif (isset($current[$key])) { |
| 333 | - $current =& $current[$key]; |
|
| 333 | + $current = & $current[$key]; |
|
| 334 | 334 | } else { |
| 335 | 335 | $current[$key] = array(); |
| 336 | - $current =& $current[$key]; |
|
| 336 | + $current = & $current[$key]; |
|
| 337 | 337 | } |
| 338 | 338 | } |
| 339 | 339 | |
@@ -354,7 +354,7 @@ discard block |
||
| 354 | 354 | public function getPath($path, $separator = '/', $data = null) |
| 355 | 355 | { |
| 356 | 356 | if ($data === null) { |
| 357 | - $data =& $this->data; |
|
| 357 | + $data = & $this->data; |
|
| 358 | 358 | } |
| 359 | 359 | |
| 360 | 360 | $path = is_array($path) ? $path : explode($separator, $path); |
@@ -362,7 +362,7 @@ discard block |
||
| 362 | 362 | if (!is_array($data)) { |
| 363 | 363 | return null; |
| 364 | 364 | } elseif (isset($data[$part])) { |
| 365 | - $data =& $data[$part]; |
|
| 365 | + $data = & $data[$part]; |
|
| 366 | 366 | } elseif ($part != '*') { |
| 367 | 367 | return null; |
| 368 | 368 | } else { |
@@ -165,6 +165,9 @@ |
||
| 165 | 165 | )) ?: false; |
| 166 | 166 | } |
| 167 | 167 | |
| 168 | + /** |
|
| 169 | + * @param string $filter |
|
| 170 | + */ |
|
| 168 | 171 | protected function handleCompression($filter, $offsetStart = 0) |
| 169 | 172 | { |
| 170 | 173 | // @codeCoverageIgnoreStart |
@@ -16,7 +16,7 @@ |
||
| 16 | 16 | |
| 17 | 17 | /** |
| 18 | 18 | * @param string $header Name of the header |
| 19 | - * @param array|string $values Values of the header as an array or a scalar |
|
| 19 | + * @param string|null $values Values of the header as an array or a scalar |
|
| 20 | 20 | * @param string $glue Glue used to combine multiple values into a string |
| 21 | 21 | */ |
| 22 | 22 | public function __construct($header, $values = array(), $glue = ',') |
@@ -101,7 +101,7 @@ |
||
| 101 | 101 | |
| 102 | 102 | public function removeValue($searchValue) |
| 103 | 103 | { |
| 104 | - $this->values = array_values(array_filter($this->values, function ($value) use ($searchValue) { |
|
| 104 | + $this->values = array_values(array_filter($this->values, function($value) use ($searchValue) { |
|
| 105 | 105 | return $value != $searchValue; |
| 106 | 106 | })); |
| 107 | 107 | |
@@ -62,7 +62,6 @@ |
||
| 62 | 62 | /** |
| 63 | 63 | * Set the URL of the request |
| 64 | 64 | * |
| 65 | - * @param string $url|Url Full URL to set including query string |
|
| 66 | 65 | * |
| 67 | 66 | * @return self |
| 68 | 67 | */ |
@@ -190,7 +190,7 @@ discard block |
||
| 190 | 190 | /** |
| 191 | 191 | * Set the response entity body |
| 192 | 192 | * |
| 193 | - * @param EntityBodyInterface|string $body Body to set |
|
| 193 | + * @param string $body Body to set |
|
| 194 | 194 | * |
| 195 | 195 | * @return self |
| 196 | 196 | */ |
@@ -296,7 +296,7 @@ discard block |
||
| 296 | 296 | /** |
| 297 | 297 | * Get the response status code |
| 298 | 298 | * |
| 299 | - * @return integer |
|
| 299 | + * @return string |
|
| 300 | 300 | */ |
| 301 | 301 | public function getStatusCode() |
| 302 | 302 | { |
@@ -377,7 +377,7 @@ discard block |
||
| 377 | 377 | /** |
| 378 | 378 | * Get the Age HTTP header |
| 379 | 379 | * |
| 380 | - * @return integer|null Returns the age the object has been in a proxy cache in seconds. |
|
| 380 | + * @return string Returns the age the object has been in a proxy cache in seconds. |
|
| 381 | 381 | */ |
| 382 | 382 | public function getAge() |
| 383 | 383 | { |
@@ -583,7 +583,7 @@ discard block |
||
| 583 | 583 | /** |
| 584 | 584 | * Get the Pragma HTTP header |
| 585 | 585 | * |
| 586 | - * @return Header|null Returns the implementation-specific headers that may have various effects anywhere along |
|
| 586 | + * @return string Returns the implementation-specific headers that may have various effects anywhere along |
|
| 587 | 587 | * the request-response chain. |
| 588 | 588 | */ |
| 589 | 589 | public function getPragma() |
@@ -604,7 +604,7 @@ discard block |
||
| 604 | 604 | /** |
| 605 | 605 | * Get the Retry-After HTTP header |
| 606 | 606 | * |
| 607 | - * @return int|null If an entity is temporarily unavailable, this instructs the client to try again after a |
|
| 607 | + * @return string If an entity is temporarily unavailable, this instructs the client to try again after a |
|
| 608 | 608 | * specified period of time. |
| 609 | 609 | */ |
| 610 | 610 | public function getRetryAfter() |
@@ -114,7 +114,7 @@ |
||
| 114 | 114 | |
| 115 | 115 | $response = new static($data['code'], $data['headers'], $data['body']); |
| 116 | 116 | $response->setProtocol($data['protocol'], $data['version']) |
| 117 | - ->setStatus($data['code'], $data['reason_phrase']); |
|
| 117 | + ->setStatus($data['code'], $data['reason_phrase']); |
|
| 118 | 118 | |
| 119 | 119 | // Set the appropriate Content-Length if the one set is inaccurate (e.g. setting to X) |
| 120 | 120 | $contentLength = (string) $response->getHeader('Content-Length'); |
@@ -619,7 +619,7 @@ |
||
| 619 | 619 | */ |
| 620 | 620 | public function getServer() |
| 621 | 621 | { |
| 622 | - return (string) $this->getHeader('Server'); |
|
| 622 | + return (string) $this->getHeader('Server'); |
|
| 623 | 623 | } |
| 624 | 624 | |
| 625 | 625 | /** |