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 string $subject Title or Subject line for the notification |
||
16 | * @return \Monolog\Handler\HandlerInterface A handler to use with a Monolog\Logger instance |
||
17 | */ |
||
18 | 15 | 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 | 6 | protected function fleephook() { |
|
35 | |||
36 | /** |
||
37 | * Creates HipChat Monolog Handler |
||
38 | * @return \Monolog\Handler\HipChatHandler A handler to use with a Monolog\Logger instance |
||
39 | */ |
||
40 | 6 | protected function hipchat() { |
|
54 | |||
55 | /** |
||
56 | * Creates Flowdock Monolog Handler |
||
57 | * @return \Monolog\Handler\FlowdockHandler A handler to use with a Monolog\Logger instance |
||
58 | */ |
||
59 | 6 | protected function flowdock() { |
|
64 | |||
65 | /** |
||
66 | * Creates Pushover Monolog Handler |
||
67 | * @param string $subject Title or Subject line for the notification |
||
68 | * @return \Monolog\Handler\PushoverHandler A handler to use with a Monolog\Logger instance |
||
69 | */ |
||
70 | 9 | protected function pushover($subject) |
|
79 | |||
80 | /** |
||
81 | * Creates Mail Monolog Handler |
||
82 | * @param string $subject Title or Subject line for the notification |
||
83 | * @return \Monolog\Handler\NativeMailerHandler A handler to use with a Monolog\Logger instance |
||
84 | */ |
||
85 | 9 | protected function mail($subject) |
|
94 | |||
95 | /** |
||
96 | * Creates Slack Monolog Handler |
||
97 | * @return \Monolog\Handler\SlackHandler A handler to use with a Monolog\Logger instance |
||
98 | */ |
||
99 | 12 | protected function slack() |
|
107 | |||
108 | /** |
||
109 | * Creates Plivo Monolog Handler |
||
110 | * @return \Tylercd100\Monolog\Handler\PlivoHandler A handler to use with a Monolog\Logger instance |
||
111 | */ |
||
112 | 6 | protected function plivo() |
|
121 | /** |
||
122 | * Validates that the subject is an unempty string |
||
123 | * @param mixed $subject The value to check |
||
124 | * @return void |
||
125 | */ |
||
126 | 12 | private function checkSubject($subject) { |
|
135 | } |