function CheckPlatformReqsCommand::printTable
Parameters
mixed[] $results:
1 call to CheckPlatformReqsCommand::printTable()
- CheckPlatformReqsCommand::execute in vendor/
composer/ composer/ src/ Composer/ Command/ CheckPlatformReqsCommand.php - Executes the current command.
File
-
vendor/
composer/ composer/ src/ Composer/ Command/ CheckPlatformReqsCommand.php, line 175
Class
Namespace
Composer\CommandCode
protected function printTable(OutputInterface $output, array $results, string $format) : void {
$rows = [];
foreach ($results as $result) {
/**
* @var Link|null $link
*/
[
$platformPackage,
$version,
$link,
$status,
$provider,
] = $result;
if ('json' === $format) {
$rows[] = [
"name" => $platformPackage,
"version" => $version,
"status" => strip_tags($status),
"failed_requirement" => $link instanceof Link ? [
'source' => $link->getSource(),
'type' => $link->getDescription(),
'target' => $link->getTarget(),
'constraint' => $link->getPrettyConstraint(),
] : null,
"provider" => $provider === '' ? null : strip_tags($provider),
];
}
else {
$rows[] = [
$platformPackage,
$version,
$link,
$link ? sprintf('%s %s %s (%s)', $link->getSource(), $link->getDescription(), $link->getTarget(), $link->getPrettyConstraint()) : '',
rtrim($status . ' ' . $provider),
];
}
}
if ('json' === $format) {
$this->getIO()
->write(JsonFile::encode($rows));
}
else {
$this->renderTable($rows, $output);
}
}