1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-08-09 14:46:46 +02: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'])) { if (isset($frame['file'])) {
$data['trace'][] = $frame['file'].':'.$frame['line']; $data['trace'][] = $frame['file'].':'.$frame['line'];
} else { } else {
$this->convertResourceArgs($frame); $frame = $this->convertResourceArgs($frame);
$data['trace'][] = json_encode($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. * 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)) { if (is_scalar($item)) {
continue; continue;
} }
@@ -155,8 +156,10 @@ class NormalizerFormatter implements FormatterInterface
} }
if (is_array($item)) { if (is_array($item)) {
$this->convertResourceArgs($item); $frame[$key] = $this->convertResourceArgs($item);
} }
} }
return $frame;
} }
} }