Passed
Push — master ( bffbb7...bd72d4 )
by 世昌
02:18
created

FileLogger   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 11
dl 0
loc 33
rs 10
c 0
b 0
f 0
wmc 8

4 Methods

Rating   Name   Duplication   Size   Complexity  
A log() 0 2 1
A applyConfig() 0 2 1
A __construct() 0 2 1
A interpolate() 0 9 5
1
<?php
2
namespace nebula\component\debug\log\logger;
3
4
class FileLogger extends AbstractLogger
0 ignored issues
show
Bug introduced by
The type nebula\component\debug\log\logger\AbstractLogger was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
5
{
6
    protected $config = [
7
        'save-path' => './logs',
8
        'max-file-size' => 2097152,
9
        'file-name' => 'latest.log',
10
    ];
11
12
    protected $file;
13
14
    public function __construct()
15
    {
16
    }
17
18
   
19
    public function applyConfig(array $value)
20
    {
21
    }
22
23
    public function log($level, string $message, array $context = [])
24
    {
25
    }
26
27
28
    public function interpolate(string $message, array $context)
29
    {
30
        $replace = array();
31
        foreach ($context as $key => $val) {
32
            if (!is_array($val) && (!is_object($val) || method_exists($val, '__toString'))) {
33
                $replace['{' . $key . '}'] = $val;
34
            }
35
        }
36
        return strtr($message, $replace);
37
    }
38
}
39