InfluxDBLogChannel   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 7
c 1
b 0
f 0
dl 0
loc 12
ccs 0
cts 8
cp 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 10 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Umbrellio\TableSync\Integration\Laravel;
6
7
use Illuminate\Log\LogManager;
8
use InfluxDB\Database;
9
use Monolog\Logger;
10
use Psr\Log\LoggerInterface;
11
use Umbrellio\TableSync\Monolog\Handler\InfluxDBHandler;
12
13
class InfluxDBLogChannel extends LogManager
14
{
15
    public function __invoke(array $config): LoggerInterface
16
    {
17
        $handler = new InfluxDBHandler(
18
            $this->app->make(Database::class),
19
            $config['measurement'] ?? null,
20
            $config['level'] ?? Logger::INFO,
21
            $config['bubble'] ?? true
22
        );
23
24
        return new Logger($this->parseChannel($config), [$handler]);
25
    }
26
}
27