NormalizerFormatter   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
eloc 7
dl 0
loc 20
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A normalize() 0 13 4
1
<?php
2
3
namespace Norsys\LogsBundle\Formatter;
4
5
use Monolog\Formatter\NormalizerFormatter as BaseFormatter;
6
7
/**
8
 * Class NormalizerFormatter
9
 */
10
class NormalizerFormatter extends BaseFormatter
11
{
12
    /**
13
     * @param mixed $data
14
     *
15
     * @return array
16
     */
17
    protected function normalize($data)
18
    {
19 1
        $data = parent::normalize($data);
20
21 1
        if (is_array($data) === true) {
22 1
            foreach ($data as $key => &$value) {
23 1
                if (is_array($value) === true) {
24 1
                    $value = json_encode($value);
25
                }
26
            }
27
        }
28
29 1
        return $data;
30
    }
31
}
32