X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fconsolidation%2Foutput-formatters%2Fsrc%2FStructuredData%2FAbstractStructuredList.php;fp=vendor%2Fconsolidation%2Foutput-formatters%2Fsrc%2FStructuredData%2FAbstractStructuredList.php;h=ee25af686c2d7d65714a7daf13a4bd11e50784ab;hp=ee09a5a4ac9b4977fa5154f60e06bbb917cb599a;hb=0bf8d09d2542548982e81a441b1f16e75873a04f;hpb=74df008bdbb3a11eeea356744f39b802369bda3c diff --git a/vendor/consolidation/output-formatters/src/StructuredData/AbstractStructuredList.php b/vendor/consolidation/output-formatters/src/StructuredData/AbstractStructuredList.php index ee09a5a4a..ee25af686 100644 --- a/vendor/consolidation/output-formatters/src/StructuredData/AbstractStructuredList.php +++ b/vendor/consolidation/output-formatters/src/StructuredData/AbstractStructuredList.php @@ -4,7 +4,6 @@ namespace Consolidation\OutputFormatters\StructuredData; use Consolidation\OutputFormatters\StructuredData\RestructureInterface; use Consolidation\OutputFormatters\Options\FormatterOptions; use Consolidation\OutputFormatters\StructuredData\ListDataInterface; -use Consolidation\OutputFormatters\Transformations\ReorderFields; use Consolidation\OutputFormatters\Transformations\TableTransformation; /** @@ -14,7 +13,7 @@ use Consolidation\OutputFormatters\Transformations\TableTransformation; * * It is presumed that every row contains the same keys. */ -abstract class AbstractStructuredList extends ListDataFromKeys implements RestructureInterface, RenderCellCollectionInterface +abstract class AbstractStructuredList extends AbstractListData implements RestructureInterface, RenderCellCollectionInterface { use RenderCellCollectionTrait; @@ -43,45 +42,11 @@ abstract class AbstractStructuredList extends ListDataFromKeys implements Restru return new TableTransformation($data, $fieldLabels, $rowLabels); } - protected function getReorderedFieldLabels($data, $options, $defaults) - { - $reorderer = new ReorderFields(); - $fieldLabels = $reorderer->reorder( - $this->getFields($options, $defaults), - $options->get(FormatterOptions::FIELD_LABELS, $defaults), - $data - ); - return $fieldLabels; - } - - protected function getFields($options, $defaults) - { - $fieldShortcut = $options->get(FormatterOptions::FIELD); - if (!empty($fieldShortcut)) { - return [$fieldShortcut]; - } - $result = $options->get(FormatterOptions::FIELDS, $defaults); - if (!empty($result)) { - return $result; - } - return $options->get(FormatterOptions::DEFAULT_FIELDS, $defaults); - } - - /** - * A structured list may provide its own set of default options. These - * will be used in place of the command's default options (from the - * annotations) in instances where the user does not provide the options - * explicitly (on the commandline) or implicitly (via a configuration file). - * - * @return array - */ protected function defaultOptions() { return [ - FormatterOptions::FIELDS => [], - FormatterOptions::FIELD_LABELS => [], FormatterOptions::ROW_LABELS => [], FormatterOptions::DEFAULT_FIELDS => [], - ]; + ] + parent::defaultOptions(); } }