protected function normalize($data) { if (is_object($data) && !$data instanceof DateTime) { return $data; } return parent::normalize($data); }
protected function normalize($data) { if (is_bool($data) || is_null($data)) { return var_export($data, true); } if ($data instanceof Exception) { $previousText = ''; if (version_compare(PHP_VERSION, '5.3') >= 0 && ($previous = $data->getPrevious())) { do { $previousText .= ', ' . get_class($previous) . ': ' . $previous->getMessage() . ' at ' . $previous->getFile() . ':' . $previous->getLine(); } while ($previous = $previous->getPrevious()); } return '[object] (' . get_class($data) . ': ' . $data->getMessage() . ' at ' . $data->getFile() . ':' . $data->getLine() . $previousText . ')'; } return parent::normalize($data); }