LogFormatter   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

1 Method

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