1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-02-23 22:42:38 +01:00

Remove reference use, refs #474

This commit is contained in:
Jordi Boggiano 2014-12-16 10:23:16 +00:00
parent 07974d92c4
commit 7db9d6ef4a

View File

@ -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;
}
}