mirror of
https://github.com/Seldaek/monolog.git
synced 2025-10-23 17:46:09 +02:00
Remove code duplication, refs #435
This commit is contained in:
@@ -73,7 +73,7 @@ class LineFormatter extends NormalizerFormatter
|
||||
|
||||
foreach ($vars['extra'] as $var => $val) {
|
||||
if (false !== strpos($output, '%extra.'.$var.'%')) {
|
||||
$output = str_replace('%extra.'.$var.'%', $this->replaceNewlines($this->convertToString($val)), $output);
|
||||
$output = str_replace('%extra.'.$var.'%', $this->stringify($val), $output);
|
||||
unset($vars['extra'][$var]);
|
||||
}
|
||||
}
|
||||
@@ -92,7 +92,7 @@ class LineFormatter extends NormalizerFormatter
|
||||
|
||||
foreach ($vars as $var => $val) {
|
||||
if (false !== strpos($output, '%'.$var.'%')) {
|
||||
$output = str_replace('%'.$var.'%', $this->replaceNewlines($this->convertToString($val)), $output);
|
||||
$output = str_replace('%'.$var.'%', $this->stringify($val), $output);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -109,6 +109,11 @@ class LineFormatter extends NormalizerFormatter
|
||||
return $message;
|
||||
}
|
||||
|
||||
public function stringify($value)
|
||||
{
|
||||
return $this->replaceNewlines($this->convertToString($value));
|
||||
}
|
||||
|
||||
protected function normalizeException(Exception $e)
|
||||
{
|
||||
$previousText = '';
|
||||
|
Reference in New Issue
Block a user