12345678910111213141516171819202122232425262728293031 |
- <?php
- namespace Fgm\ComposerCheck;
- /**
- * Class YamlReporter formats a requirements set as a console table.
- */
- class DrushReporter extends ReporterBase {
- /**
- * {@inheritdoc}
- */
- public function report(MergeBox $mergeBox) : string {
- $header = ['Name', 'Kind', 'Requirement', 'Version'];
- $rows = [$header];
- foreach ($mergeBox->getRows() as $kind => $kindPackages) {
- foreach ($kindPackages as $package => $info) {
- $rows["$package/$kind"] = [
- $package,
- $kind,
- $info['requirement'] ?? '',
- $info['version'] ?? '',
- ];
- }
- }
- ksort($rows);
- drush_print_table($rows, FALSE);
- }
- }
|