DefaultFormatter   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 18
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A format() 0 9 2
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