1 | <?php |
||
10 | class FormatterManager |
||
11 | { |
||
12 | protected $formatters = []; |
||
13 | |||
14 | public function __construct() |
||
30 | |||
31 | /** |
||
32 | * Format and write output |
||
33 | * |
||
34 | * @param OutputInterface $output Output stream to write to |
||
35 | * @param string $format Data format to output in |
||
36 | * @param mixed $structuredOutput Data to output |
||
37 | * @param array $annotationData Configuration information for formatter |
||
38 | * @param array $options User options |
||
39 | */ |
||
40 | public function write(OutputInterface $output, $format, $structuredOutput, $annotationData = [], $options = []) |
||
52 | |||
53 | /** |
||
54 | * Fetch the requested formatter. |
||
55 | * |
||
56 | * @param string $format Identifier for requested formatter |
||
57 | * @param array $configurationData Configuration data for formatter |
||
58 | * @return FormatterInterface |
||
59 | */ |
||
60 | public function getFormatter($format, $configurationData = []) |
||
72 | |||
73 | public function hasFormatter($format) |
||
77 | |||
78 | /** |
||
79 | * Determine if the provided data is compatible with the formatter being used. |
||
80 | * |
||
81 | * @param FormatterInterface $formatter Formatter being used |
||
82 | * @param mixed $structuredOutput Data to validate |
||
83 | * @return mixed |
||
84 | */ |
||
85 | public function validateData(FormatterInterface $formatter, $structuredOutput) |
||
101 | |||
102 | /** |
||
103 | * Restructure the data as necessary (e.g. to select or reorder fields). |
||
104 | * |
||
105 | * @param mixed $structuredOutput |
||
106 | * @param array $configurationData |
||
107 | * @param array $options |
||
108 | * @return mixed |
||
109 | */ |
||
110 | public function restructureData($structuredOutput, $configurationData, $options) |
||
117 | } |
||
118 |