interface SimplifyToArrayInterface (View source)

Methods

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

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.

Parameters

mixed $structuredOutput

The data to simplify to an array.

FormatterOptions $options

Return Value

array

canSimplify(ReflectionClass $structuredOutput)

Indicate whether or not the given data type can be simplified to an array

Parameters

ReflectionClass $structuredOutput