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

ChannelSet::__call()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 2
c 1
b 0
f 0
nc 2
nop 2
dl 0
loc 4
ccs 3
cts 3
cp 1
crap 2
rs 10
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