ErrorLogger   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A log() 0 10 2
1
<?php
2
3
/*
4
 * This file is part of the Bouncer package.
5
 *
6
 * (c) François Hodierne <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Bouncer\Logger;
13
14
class ErrorLogger extends BaseLogger
15
{
16
17
    /**
18
     * {@inheritDoc}
19
     */
20
    public function log(array $logEntry)
21
    {
22
        $entry = $this->format($logEntry);
23
24
        if (defined('JSON_PRETTY_PRINT')) {
25
          error_log(json_encode($entry, JSON_PRETTY_PRINT));
26
        } else {
27
          error_log(json_encode($entry));
28
        }
29
    }
30
31
}
32