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 | 24 | public function create($driver, $subject = null) |
|
27 | |||
28 | /** |
||
29 | * Creates FleepHook Monolog Handler |
||
30 | * @return \Monolog\Handler\FleepHookHandler A handler to use with a Monolog\Logger instance |
||
31 | */ |
||
32 | 6 | protected function fleephook() { |
|
37 | |||
38 | /** |
||
39 | * Creates HipChat Monolog Handler |
||
40 | * @return \Monolog\Handler\HipChatHandler A handler to use with a Monolog\Logger instance |
||
41 | */ |
||
42 | 6 | protected function hipchat() { |
|
56 | |||
57 | /** |
||
58 | * Creates Flowdock Monolog Handler |
||
59 | * @return \Monolog\Handler\FlowdockHandler A handler to use with a Monolog\Logger instance |
||
60 | */ |
||
61 | 6 | protected function flowdock() { |
|
66 | |||
67 | /** |
||
68 | * Creates Pushover Monolog Handler |
||
69 | * @param string $subject Title or Subject line for the notification |
||
70 | * @return \Monolog\Handler\PushoverHandler A handler to use with a Monolog\Logger instance |
||
71 | */ |
||
72 | 9 | protected function pushover($subject) |
|
81 | |||
82 | /** |
||
83 | * Creates Mail Monolog Handler |
||
84 | * @param string $subject Title or Subject line for the notification |
||
85 | * @return \Monolog\Handler\NativeMailerHandler A handler to use with a Monolog\Logger instance |
||
86 | */ |
||
87 | 15 | protected function mail($subject) |
|
96 | |||
97 | /** |
||
98 | * Creates Slack Monolog Handler |
||
99 | * @return \Monolog\Handler\SlackHandler A handler to use with a Monolog\Logger instance |
||
100 | */ |
||
101 | 12 | protected function slack() |
|
109 | |||
110 | /** |
||
111 | * Creates Plivo Monolog Handler |
||
112 | * @return \Tylercd100\Monolog\Handler\PlivoHandler A handler to use with a Monolog\Logger instance |
||
113 | */ |
||
114 | 6 | protected function plivo() |
|
123 | |||
124 | /** |
||
125 | * Creates Twilio Monolog Handler |
||
126 | * @return \Tylercd100\Monolog\Handler\TwilioHandler A handler to use with a Monolog\Logger instance |
||
127 | */ |
||
128 | 6 | protected function twilio() |
|
137 | /** |
||
138 | * Validates that the subject is an unempty string |
||
139 | * @param mixed $subject The value to check |
||
140 | * @return void |
||
141 | */ |
||
142 | 18 | private function checkSubject($subject) { |
|
151 | } |