Merge pull request #7036 from kalessil/master
[minor] SCA: reduced repetitive method callspull/7005/merge
commit
2224989430
|
@ -66,8 +66,9 @@ EOT
|
||||||
$composer = $this->getComposer(false);
|
$composer = $this->getComposer(false);
|
||||||
if ($composer) {
|
if ($composer) {
|
||||||
$commandEvent = new CommandEvent(PluginEvents::COMMAND, 'archive', $input, $output);
|
$commandEvent = new CommandEvent(PluginEvents::COMMAND, 'archive', $input, $output);
|
||||||
$composer->getEventDispatcher()->dispatch($commandEvent->getName(), $commandEvent);
|
$eventDispatcher = $composer->getEventDispatcher();
|
||||||
$composer->getEventDispatcher()->dispatchScript(ScriptEvents::PRE_ARCHIVE_CMD);
|
$eventDispatcher->dispatch($commandEvent->getName(), $commandEvent);
|
||||||
|
$eventDispatcher->dispatchScript(ScriptEvents::PRE_ARCHIVE_CMD);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (null === $input->getOption('format')) {
|
if (null === $input->getOption('format')) {
|
||||||
|
|
|
@ -180,8 +180,9 @@ class BaseDependencyCommand extends BaseCommand
|
||||||
// Render table
|
// Render table
|
||||||
$renderer = new Table($output);
|
$renderer = new Table($output);
|
||||||
$renderer->setStyle('compact');
|
$renderer->setStyle('compact');
|
||||||
$renderer->getStyle()->setVerticalBorderChar('');
|
$rendererStyle = $renderer->getStyle();
|
||||||
$renderer->getStyle()->setCellRowContentFormat('%s ');
|
$rendererStyle->setVerticalBorderChar('');
|
||||||
|
$rendererStyle->setCellRowContentFormat('%s ');
|
||||||
$renderer->setRows($table)->render();
|
$renderer->setRows($table)->render();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -142,8 +142,9 @@ EOT
|
||||||
// Render table
|
// Render table
|
||||||
$renderer = new Table($output);
|
$renderer = new Table($output);
|
||||||
$renderer->setStyle('compact');
|
$renderer->setStyle('compact');
|
||||||
$renderer->getStyle()->setVerticalBorderChar('');
|
$rendererStyle = $renderer->getStyle();
|
||||||
$renderer->getStyle()->setCellRowContentFormat('%s ');
|
$rendererStyle->setVerticalBorderChar('');
|
||||||
|
$rendererStyle->setCellRowContentFormat('%s ');
|
||||||
$renderer->setRows($table)->render();
|
$renderer->setRows($table)->render();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,8 +74,9 @@ EOT
|
||||||
|
|
||||||
$table = new Table($output);
|
$table = new Table($output);
|
||||||
$table->setStyle('compact');
|
$table->setStyle('compact');
|
||||||
$table->getStyle()->setVerticalBorderChar('');
|
$tableStyle = $table->getStyle();
|
||||||
$table->getStyle()->setCellRowContentFormat('%s ');
|
$tableStyle->setVerticalBorderChar('');
|
||||||
|
$tableStyle->setCellRowContentFormat('%s ');
|
||||||
$table->setHeaders(array('Name', 'Version', 'License'));
|
$table->setHeaders(array('Name', 'Version', 'License'));
|
||||||
foreach ($packages as $package) {
|
foreach ($packages as $package) {
|
||||||
$table->addRow(array(
|
$table->addRow(array(
|
||||||
|
|
|
@ -124,8 +124,9 @@ EOT
|
||||||
|
|
||||||
$renderer = new Table($output);
|
$renderer = new Table($output);
|
||||||
$renderer->setStyle('compact');
|
$renderer->setStyle('compact');
|
||||||
$renderer->getStyle()->setVerticalBorderChar('');
|
$rendererStyle = $renderer->getStyle();
|
||||||
$renderer->getStyle()->setCellRowContentFormat('%s ');
|
$rendererStyle->setVerticalBorderChar('');
|
||||||
|
$rendererStyle->setCellRowContentFormat('%s ');
|
||||||
$renderer->setRows($table)->render();
|
$renderer->setRows($table)->render();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -169,7 +169,7 @@ final class StreamContextFactory
|
||||||
$header = explode("\r\n", $header);
|
$header = explode("\r\n", $header);
|
||||||
}
|
}
|
||||||
uasort($header, function ($el) {
|
uasort($header, function ($el) {
|
||||||
return preg_match('{^content-type}i', $el) ? 1 : -1;
|
return stripos($el, 'content-type') === 0 ? 1 : -1;
|
||||||
});
|
});
|
||||||
|
|
||||||
return $header;
|
return $header;
|
||||||
|
|
Loading…
Reference in New Issue