Completed
Push — 6.0 ( cb8a0b...bb9f45 )
by yun
06:00
created

ChannelSet   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A __call() 0 4 2
1
<?php
2
0 ignored issues
show
Coding Style introduced by
Missing file doc comment
Loading history...
3
namespace think\log;
4
5
use think\Log;
6
7
/**
8
 * Class ChannelSet
9
 * @package think\log
0 ignored issues
show
Coding Style introduced by
Package name "think\log" is not valid; consider "Thinklog" instead
Loading history...
10
 * @mixin Channel
11
 */
12
class ChannelSet
13
{
14
    protected $log;
15
    protected $channels;
16
17 2
    public function __construct(Log $log, array $channels)
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function __construct()
Loading history...
18
    {
19 2
        $this->log      = $log;
20 2
        $this->channels = $channels;
21 2
    }
22
23 1
    public function __call($method, $arguments)
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function __call()
Loading history...
24
    {
25 1
        foreach ($this->channels as $channel) {
26 1
            $this->log->driver($channel)->{$method}(...$arguments);
27
        }
28 1
    }
29
}
30