toString($config), $flags); } catch (\Exception $e) { restore_error_handler(); throw $e; } restore_error_handler(); } /** * toString(): defined by Writer interface. * * @see WriterInterface::toString() * @param mixed $config * @return string * @throws Exception\InvalidArgumentException */ public function toString($config) { if ($config instanceof Traversable) { $config = ArrayUtils::iteratorToArray($config); } elseif (!is_array($config)) { throw new Exception\InvalidArgumentException(__METHOD__ . ' expects an array or Traversable config'); } return $this->processConfig($config); } /** * @param array $config * @return string */ abstract protected function processConfig(array $config); }