Version 1
[yaffs-website] / vendor / consolidation / output-formatters / src / Transformations / SimplifyToArrayInterface.php
diff --git a/vendor/consolidation/output-formatters/src/Transformations/SimplifyToArrayInterface.php b/vendor/consolidation/output-formatters/src/Transformations/SimplifyToArrayInterface.php
new file mode 100644 (file)
index 0000000..7b088ae
--- /dev/null
@@ -0,0 +1,26 @@
+<?php
+namespace Consolidation\OutputFormatters\Transformations;
+
+use Consolidation\OutputFormatters\Options\FormatterOptions;
+
+interface SimplifyToArrayInterface
+{
+    /**
+     * Convert structured data into a generic array, usable by generic
+     * array-based formatters.  Objects that implement this interface may
+     * be attached to the FormatterManager, and will be used on any data
+     * structure that needs to be simplified into an array.  An array
+     * simplifier should take no action other than to return its input data
+     * if it cannot simplify the provided data into an array.
+     *
+     * @param mixed $structuredOutput The data to simplify to an array.
+     *
+     * @return array
+     */
+    public function simplifyToArray($structuredOutput, FormatterOptions $options);
+
+    /**
+     * Indicate whether or not the given data type can be simplified to an array
+     */
+    public function canSimplify(\ReflectionClass $structuredOutput);
+}