JsonDateAwareFormatter   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 25
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A format() 0 4 1
A formatBatch() 0 3 1
1
<?php
2
/*
3
 * This file is part of Monolog Extensions
4
 *
5
 * Copyright (c) 2014 Nature Delivered Ltd. <http://graze.com>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 *
10
 * @see  http://github.com/graze/MonologExtensions/blob/master/LICENSE
11
 * @link http://github.com/graze/MonologExtensions
12
 */
13
14
namespace Graze\Monolog\Formatter;
15
16
use Monolog\Formatter\NormalizerFormatter;
17
18
class JsonDateAwareFormatter extends NormalizerFormatter
19
{
20
    /**
21
     * {@inheritdoc}
22
     *
23
     * @param  array $record A record to format
24
     *
25
     * @return mixed The formatted record
26
     */
27 3
    public function format(array $record)
28
    {
29 3
        $data = parent::format($record);
30 3
        return $this->toJson($data, true);
31
    }
32
33
    /**
34
     * {@inheritdoc}
35
     *
36
     * @param  array $records A set of records to format
37
     *
38
     * @return mixed The formatted set of records
39
     */
40 1
    public function formatBatch(array $records)
41
    {
42 1
        return $this->format($records);
43
    }
44
}
45