diff vendor/consolidation/output-formatters/src/Transformations/SimplifyToArrayInterface.php @ 0:4c8ae668cc8c

Initial import (non-working)
author Chris Cannam
date Wed, 29 Nov 2017 16:09:58 +0000
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/consolidation/output-formatters/src/Transformations/SimplifyToArrayInterface.php	Wed Nov 29 16:09:58 2017 +0000
@@ -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);
+}