function ShowCommand::printLinks
print link objects
Parameters
string $title:
1 call to ShowCommand::printLinks()
- ShowCommand::printPackageInfo in vendor/
composer/ composer/ src/ Composer/ Command/ ShowCommand.php - Prints package info.
File
-
vendor/
composer/ composer/ src/ Composer/ Command/ ShowCommand.php, line 982
Class
- ShowCommand
- @author Robert Schönthal <seroscho@googlemail.com> @author Jordi Boggiano <j.boggiano@seld.be> @author Jérémy Romey <jeremyFreeAgent> @author Mihai Plasoianu <mihai@plasoianu.de>
Namespace
Composer\CommandCode
protected function printLinks(CompletePackageInterface $package, string $linkType, ?string $title = null) : void {
$title = $title ?: $linkType;
$io = $this->getIO();
if ($links = $package->{'get' . ucfirst($linkType)}()) {
$io->write("\n<info>" . $title . "</info>");
foreach ($links as $link) {
$io->write($link->getTarget() . ' <comment>' . $link->getPrettyConstraint() . '</comment>');
}
}
}