1 | <?php |
||
8 | class ChannelStreamHandler extends StreamHandler |
||
9 | { |
||
10 | |||
11 | /** |
||
12 | * @var string |
||
13 | */ |
||
14 | private $channel; |
||
15 | |||
16 | /** |
||
17 | * @param string $stream |
||
18 | * @param bool|int $level |
||
19 | * @param string|null $channel |
||
20 | * @param bool $bubble |
||
21 | */ |
||
22 | 10 | public function __construct( |
|
23 | $stream, |
||
24 | $level = Logger::DEBUG, |
||
25 | $channel = null, |
||
26 | $bubble = true |
||
27 | ) { |
||
28 | 10 | parent::__construct($stream, $level, $bubble); |
|
|
|||
29 | |||
30 | 10 | $formatter = new Formatter( |
|
31 | 10 | null, |
|
32 | 10 | null, |
|
33 | 10 | false, |
|
34 | 10 | true |
|
35 | ); |
||
36 | |||
37 | 10 | $this->setFormatter( |
|
38 | $formatter |
||
39 | ); |
||
40 | |||
41 | 10 | $this->channel = $channel; |
|
42 | 10 | } |
|
43 | |||
44 | /** |
||
45 | * @param string $channel |
||
46 | */ |
||
47 | 7 | public function setChannel(string $channel) |
|
51 | |||
52 | /** |
||
53 | * {@inheritdoc} |
||
54 | */ |
||
55 | 9 | public function isHandling(array $record) : bool |
|
77 | } |
||
78 |
This check looks at variables that have been passed in as parameters and are passed out again to other methods.
If the outgoing method call has stricter type requirements than the method itself, an issue is raised.
An additional type check may prevent trouble.