Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / vendor / consolidation / output-formatters / src / StructuredData / UnstructuredData.php
diff --git a/vendor/consolidation/output-formatters/src/StructuredData/UnstructuredData.php b/vendor/consolidation/output-formatters/src/StructuredData/UnstructuredData.php
new file mode 100644 (file)
index 0000000..6de973e
--- /dev/null
@@ -0,0 +1,30 @@
+<?php
+namespace Consolidation\OutputFormatters\StructuredData;
+
+use Consolidation\OutputFormatters\Options\FormatterOptions;
+use Consolidation\OutputFormatters\StructuredData\RestructureInterface;
+use Consolidation\OutputFormatters\Transformations\UnstructuredDataTransformation;
+
+/**
+ * Represents aribtrary unstructured array data where the
+ * data to display in --list format comes from the array keys.
+ *
+ * Unstructured list data can have variable keys in every rown (unlike
+ * RowsOfFields, which expects uniform rows), and the data elements may
+ * themselves be deep arrays.
+ */
+class UnstructuredData extends AbstractListData implements UnstructuredInterface, RestructureInterface
+{
+    public function __construct($data)
+    {
+        parent::__construct($data);
+    }
+
+    public function restructure(FormatterOptions $options)
+    {
+        $defaults = $this->defaultOptions();
+        $fields = $this->getFields($options, $defaults);
+
+        return new UnstructuredDataTransformation($this->getArrayCopy(), FieldProcessor::processFieldAliases($fields));
+    }
+}