SimplifyToArrayInterface
interface SimplifyToArrayInterface (View source)
Methods
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.
Indicate whether or not the given data type can be simplified to an array
Details
array
simplifyToArray(mixed $structuredOutput, FormatterOptions $options)
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.
canSimplify(ReflectionClass $structuredOutput)
Indicate whether or not the given data type can be simplified to an array