LogFormatter::__invoke()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
c 0
b 0
f 0
rs 10
cc 2
nc 2
nop 1
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: reallyli
5
 * Date: 18/10/10
6
 * Time: 下午4:45.
7
 */
8
9
namespace Reallyli\LaravelUnicomponent\Components\LogFormatter;
10
11
class LogFormatter
12
{
13
    /**
14
     * Customize the given logger instance.
15
     *
16
     * @param  \Illuminate\Log\Logger  $logger
17
     * @return void
18
     */
19
    public function __invoke($logger)
20
    {
21
        foreach ($logger->getHandlers() as $handler) {
22
            $handler->setFormatter(new JsonFormatter());
23
        }
24
    }
25
}
26