mirror of
https://github.com/Seldaek/monolog.git
synced 2025-02-24 06:52:34 +01:00
Remove reference use, refs #474
This commit is contained in:
parent
07974d92c4
commit
7db9d6ef4a
@ -108,7 +108,7 @@ class NormalizerFormatter implements FormatterInterface
|
||||
if (isset($frame['file'])) {
|
||||
$data['trace'][] = $frame['file'].':'.$frame['line'];
|
||||
} else {
|
||||
$this->convertResourceArgs($frame);
|
||||
$frame = $this->convertResourceArgs($frame);
|
||||
$data['trace'][] = json_encode($frame);
|
||||
}
|
||||
}
|
||||
@ -141,11 +141,12 @@ class NormalizerFormatter implements FormatterInterface
|
||||
/**
|
||||
* This method checks recursively for resource args inside the frame, since json_encode is choking on them.
|
||||
*
|
||||
* @param array &$frame Reference to current frame
|
||||
* @param array $frame Reference to current frame
|
||||
* @return array
|
||||
*/
|
||||
private function convertResourceArgs(array &$frame)
|
||||
private function convertResourceArgs(array $frame)
|
||||
{
|
||||
foreach ($frame as $key => &$item) {
|
||||
foreach ($frame as $key => $item) {
|
||||
if (is_scalar($item)) {
|
||||
continue;
|
||||
}
|
||||
@ -155,8 +156,10 @@ class NormalizerFormatter implements FormatterInterface
|
||||
}
|
||||
|
||||
if (is_array($item)) {
|
||||
$this->convertResourceArgs($item);
|
||||
$frame[$key] = $this->convertResourceArgs($item);
|
||||
}
|
||||
}
|
||||
|
||||
return $frame;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user