writeln(implode("\n", $data)); } /** * @inheritdoc */ public function overrideRestructure($structuredOutput, FormatterOptions $options) { // If the structured data implements ListDataInterface, // then we will render whatever data its 'getListData' // method provides. if ($structuredOutput instanceof ListDataInterface) { return $this->renderData($structuredOutput, $structuredOutput->getListData($options), $options); } } /** * @inheritdoc */ public function renderData($originalData, $restructuredData, FormatterOptions $options) { if ($originalData instanceof RenderCellInterface) { return $this->renderEachCell($originalData, $restructuredData, $options); } return $restructuredData; } protected function renderEachCell($originalData, $restructuredData, FormatterOptions $options) { foreach ($restructuredData as $key => $cellData) { $restructuredData[$key] = $originalData->renderCell($key, $cellData, $options, $restructuredData); } return $restructuredData; } }