1 | <?php |
||
8 | class MonologHandlerFactory { |
||
9 | |||
10 | protected $config; |
||
11 | |||
12 | /** |
||
13 | * Creates a handler for a specified driver |
||
14 | * @param string $driver Lowercase driver string that is also in the config/lern.php file |
||
15 | * @param array $subject Title or Subject line for the notification |
||
16 | * @return \Monolog\Handler\HandlerInterface A handler to use with a Monolog\Logger instance |
||
17 | */ |
||
18 | public function create($driver, $subject = null) |
||
25 | |||
26 | /** |
||
27 | * Creates FleepHook Monolog Handler |
||
28 | * @return \Monolog\Handler\FleepHookHandler A handler to use with a Monolog\Logger instance |
||
29 | */ |
||
30 | protected function fleephook(){ |
||
36 | |||
37 | /** |
||
38 | * Creates HipChat Monolog Handler |
||
39 | * @return \Monolog\Handler\HipChatHandler A handler to use with a Monolog\Logger instance |
||
40 | */ |
||
41 | protected function hipchat(){ |
||
50 | |||
51 | /** |
||
52 | * Creates Flowdock Monolog Handler |
||
53 | * @return \Monolog\Handler\FlowdockHandler A handler to use with a Monolog\Logger instance |
||
54 | */ |
||
55 | protected function flowdock(){ |
||
61 | |||
62 | /** |
||
63 | * Creates Pushover Monolog Handler |
||
64 | * @param array $subject Title or Subject line for the notification |
||
65 | * @return \Monolog\Handler\PushoverHandler A handler to use with a Monolog\Logger instance |
||
66 | */ |
||
67 | protected function pushover($subject) |
||
77 | |||
78 | /** |
||
79 | * Creates Mail Monolog Handler |
||
80 | * @param array $subject Title or Subject line for the notification |
||
81 | * @return \Monolog\Handler\NativeMailerHandler A handler to use with a Monolog\Logger instance |
||
82 | */ |
||
83 | protected function mail($subject) |
||
92 | |||
93 | /** |
||
94 | * Creates Slack Monolog Handler |
||
95 | * @return \Monolog\Handler\SlackHandler A handler to use with a Monolog\Logger instance |
||
96 | */ |
||
97 | protected function slack() |
||
105 | |||
106 | /** |
||
107 | * Validates that the subject is an unempty string |
||
108 | * @param mixed $subject [description] |
||
109 | * @return [type] [description] |
||
110 | */ |
||
111 | private function checkSubject($subject) { |
||
120 | } |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: