DefaultFormatter::format()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 9
rs 9.9666
c 0
b 0
f 0
cc 2
nc 2
nop 3
1
<?php
2
3
namespace Abacaphiliac\PsrLog4Php;
4
5
class DefaultFormatter implements FormatterInterface
6
{
7
    /**
8
     * @param mixed $level
9
     * @param mixed $message
10
     * @param mixed[] $context
11
     * @return mixed
12
     */
13
    public function format($level, $message, array $context = array())
14
    {
15
        if (is_string($message)) {
16
            return $message . ' ' . json_encode($context);
17
        }
18
19
        // Cannot append encoded context without causing an error, or blocking log4php object renderers.
20
        return $message;
21
    }
22
}
23