1 | <?php |
||
15 | class Yii2Monolog extends Component implements BootstrapInterface |
||
16 | { |
||
17 | /** |
||
18 | * @var array |
||
19 | */ |
||
20 | private $channels; |
||
21 | |||
22 | /** |
||
23 | * @var MonologFactory |
||
24 | */ |
||
25 | private $monologFactory; |
||
26 | |||
27 | /** |
||
28 | * @var string |
||
29 | */ |
||
30 | private $mainChannel; |
||
31 | |||
32 | /** |
||
33 | * @var LoggerRegistry |
||
34 | */ |
||
35 | private $loggerRegistry; |
||
36 | |||
37 | /** |
||
38 | * Initiates a new Yii2Monolog. |
||
39 | * |
||
40 | * @param MonologFactory $monologFactory |
||
41 | * @param LoggerRegistry $loggerRegistry |
||
42 | * @param array $config |
||
43 | */ |
||
44 | 8 | public function __construct(MonologFactory $monologFactory, LoggerRegistry $loggerRegistry, array $config = []) |
|
50 | |||
51 | /** |
||
52 | * Returns the given logger channel. |
||
53 | * |
||
54 | * @param string $channel |
||
|
|||
55 | * |
||
56 | * @return Logger |
||
57 | */ |
||
58 | 6 | public function getLogger(string $channel = null): Logger |
|
66 | |||
67 | /** |
||
68 | * {@inheritdoc} |
||
69 | */ |
||
70 | 8 | public function bootstrap($app) |
|
75 | |||
76 | /** |
||
77 | * @param array $channelConfiguration |
||
78 | */ |
||
79 | 8 | public function setChannels(array $channelConfiguration) |
|
83 | |||
84 | /** |
||
85 | * @param string $channelName |
||
86 | */ |
||
87 | 2 | public function setMainChannel(string $channelName) |
|
91 | |||
92 | /** |
||
93 | * Registers loggers into Yii's DI container. |
||
94 | */ |
||
95 | 8 | private function registerLoggers() |
|
107 | |||
108 | /** |
||
109 | * Registers the main channel to be used for Psr LoggerInterface. |
||
110 | */ |
||
111 | private function registerPsrLogger() |
||
117 | |||
118 | /** |
||
119 | * Returns the main channel to be used for Yii2Monolog component. |
||
120 | * |
||
121 | * @return string |
||
122 | */ |
||
123 | 4 | private function getMainChannel(): string |
|
131 | } |
||
132 |
This check looks for
@param
annotations where the type inferred by our type inference engine differs from the declared type.It makes a suggestion as to what type it considers more descriptive.
Most often this is a case of a parameter that can be null in addition to its declared types.