1
0
Fork 0

Add require-dev and other missing links in show command

pull/585/merge
Jordi Boggiano 2012-04-17 10:32:35 +02:00
parent 443ce65765
commit 4cc45d3c37
1 changed files with 12 additions and 3 deletions

View File

@ -78,7 +78,15 @@ EOT
$this->printMeta($input, $output, $package, $installedRepo, $repos); $this->printMeta($input, $output, $package, $installedRepo, $repos);
$this->printLinks($input, $output, $package, 'requires'); $this->printLinks($input, $output, $package, 'requires');
$this->printLinks($input, $output, $package, 'devRequires'); $this->printLinks($input, $output, $package, 'devRequires', 'requires (dev)');
if ($package->getSuggests()) {
$output->writeln("\n<info>suggests</info>");
foreach ($package->getSuggests() as $suggested => $reason) {
$output->writeln($suggested . ' <comment>' . $reason . '</comment>');
}
}
$this->printLinks($input, $output, $package, 'provides');
$this->printLinks($input, $output, $package, 'conflicts');
$this->printLinks($input, $output, $package, 'replaces'); $this->printLinks($input, $output, $package, 'replaces');
return; return;
} }
@ -209,10 +217,11 @@ EOT
* *
* @param string $linkType * @param string $linkType
*/ */
protected function printLinks(InputInterface $input, OutputInterface $output, PackageInterface $package, $linkType) protected function printLinks(InputInterface $input, OutputInterface $output, PackageInterface $package, $linkType, $title = null)
{ {
$title = $title ?: $linkType;
if ($links = $package->{'get'.ucfirst($linkType)}()) { if ($links = $package->{'get'.ucfirst($linkType)}()) {
$output->writeln("\n<info>" . $linkType . "</info>"); $output->writeln("\n<info>" . $title . "</info>");
foreach ($links as $link) { foreach ($links as $link) {
$output->writeln($link->getTarget() . ' <comment>' . $link->getPrettyConstraint() . '</comment>'); $output->writeln($link->getTarget() . ' <comment>' . $link->getPrettyConstraint() . '</comment>');