1
0
Fork 0

Merge pull request #7036 from kalessil/master

[minor] SCA: reduced repetitive method calls
pull/7005/merge
Jordi Boggiano 2018-01-24 11:27:16 +01:00 committed by GitHub
commit 2224989430
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 16 additions and 11 deletions

View File

@ -66,8 +66,9 @@ EOT
$composer = $this->getComposer(false);
if ($composer) {
$commandEvent = new CommandEvent(PluginEvents::COMMAND, 'archive', $input, $output);
$composer->getEventDispatcher()->dispatch($commandEvent->getName(), $commandEvent);
$composer->getEventDispatcher()->dispatchScript(ScriptEvents::PRE_ARCHIVE_CMD);
$eventDispatcher = $composer->getEventDispatcher();
$eventDispatcher->dispatch($commandEvent->getName(), $commandEvent);
$eventDispatcher->dispatchScript(ScriptEvents::PRE_ARCHIVE_CMD);
}
if (null === $input->getOption('format')) {

View File

@ -180,8 +180,9 @@ class BaseDependencyCommand extends BaseCommand
// Render table
$renderer = new Table($output);
$renderer->setStyle('compact');
$renderer->getStyle()->setVerticalBorderChar('');
$renderer->getStyle()->setCellRowContentFormat('%s ');
$rendererStyle = $renderer->getStyle();
$rendererStyle->setVerticalBorderChar('');
$rendererStyle->setCellRowContentFormat('%s ');
$renderer->setRows($table)->render();
}

View File

@ -142,8 +142,9 @@ EOT
// Render table
$renderer = new Table($output);
$renderer->setStyle('compact');
$renderer->getStyle()->setVerticalBorderChar('');
$renderer->getStyle()->setCellRowContentFormat('%s ');
$rendererStyle = $renderer->getStyle();
$rendererStyle->setVerticalBorderChar('');
$rendererStyle->setCellRowContentFormat('%s ');
$renderer->setRows($table)->render();
}
}

View File

@ -74,8 +74,9 @@ EOT
$table = new Table($output);
$table->setStyle('compact');
$table->getStyle()->setVerticalBorderChar('');
$table->getStyle()->setCellRowContentFormat('%s ');
$tableStyle = $table->getStyle();
$tableStyle->setVerticalBorderChar('');
$tableStyle->setCellRowContentFormat('%s ');
$table->setHeaders(array('Name', 'Version', 'License'));
foreach ($packages as $package) {
$table->addRow(array(

View File

@ -124,8 +124,9 @@ EOT
$renderer = new Table($output);
$renderer->setStyle('compact');
$renderer->getStyle()->setVerticalBorderChar('');
$renderer->getStyle()->setCellRowContentFormat('%s ');
$rendererStyle = $renderer->getStyle();
$rendererStyle->setVerticalBorderChar('');
$rendererStyle->setCellRowContentFormat('%s ');
$renderer->setRows($table)->render();
return 0;

View File

@ -169,7 +169,7 @@ final class StreamContextFactory
$header = explode("\r\n", $header);
}
uasort($header, function ($el) {
return preg_match('{^content-type}i', $el) ? 1 : -1;
return stripos($el, 'content-type') === 0 ? 1 : -1;
});
return $header;