X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fconsolidation%2Foutput-formatters%2Fsrc%2FFormatters%2FSectionsFormatter.php;fp=vendor%2Fconsolidation%2Foutput-formatters%2Fsrc%2FFormatters%2FSectionsFormatter.php;h=89ed270778907737f316266a8d75e8415493b358;hp=0000000000000000000000000000000000000000;hb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;hpb=57c063afa3f66b07c4bbddc2d6129a96d90f0aad diff --git a/vendor/consolidation/output-formatters/src/Formatters/SectionsFormatter.php b/vendor/consolidation/output-formatters/src/Formatters/SectionsFormatter.php new file mode 100644 index 000000000..89ed27077 --- /dev/null +++ b/vendor/consolidation/output-formatters/src/Formatters/SectionsFormatter.php @@ -0,0 +1,72 @@ +validDataTypes() + ); + } + return $structuredData; + } + + /** + * @inheritdoc + */ + public function write(OutputInterface $output, $tableTransformer, FormatterOptions $options) + { + $table = new Table($output); + $table->setStyle('compact'); + foreach ($tableTransformer as $rowid => $row) { + $rowLabel = $tableTransformer->getRowLabel($rowid); + $output->writeln(''); + $output->writeln($rowLabel); + $sectionData = new PropertyList($row); + $sectionOptions = new FormatterOptions([], $options->getOptions()); + $sectionTableTransformer = $sectionData->restructure($sectionOptions); + $table->setRows($sectionTableTransformer->getTableData(true)); + $table->render(); + } + } +}