setDateTimeFormat($dateTimeFormat); } } /** * Formats data to be written by the writer. * * @param array $event event data * @return array */ public function format($event) { $format = $this->getDateTimeFormat(); array_walk_recursive($event, function (&$value) use ($format) { if ($value instanceof DateTime) { $value = $value->format($format); } }); return $event; } /** * {@inheritDoc} */ public function getDateTimeFormat() { return $this->dateTimeFormat; } /** * {@inheritDoc} */ public function setDateTimeFormat($dateTimeFormat) { $this->dateTimeFormat = (string) $dateTimeFormat; return $this; } }