1 | <?php |
||
14 | class LERN |
||
15 | { |
||
16 | |||
17 | private $exception; |
||
18 | private $notifier; |
||
19 | |||
20 | /** |
||
21 | * @param Notifier|null $notifier Notifier instance |
||
22 | */ |
||
23 | 21 | public function __construct(Notifier $notifier = null) |
|
30 | |||
31 | /** |
||
32 | * Will execute record and notify methods |
||
33 | * @param Exception $e The exception to use |
||
34 | * @return ExceptionModel the recorded Eloquent Model |
||
35 | */ |
||
36 | 3 | public function handle(Exception $e) |
|
42 | |||
43 | /** |
||
44 | * Stores the exception in the database |
||
45 | * @param Exception $e The exception to use |
||
46 | * @return ExceptionModel the recorded Eloquent Model |
||
47 | */ |
||
48 | 3 | public function record(Exception $e) |
|
66 | |||
67 | /** |
||
68 | * Will send the exception to all monolog handlers |
||
69 | * @param Exception $e The exception to use |
||
70 | * @return void |
||
71 | */ |
||
72 | 3 | public function notify(Exception $e) |
|
77 | |||
78 | /** |
||
79 | * Pushes on another Monolog Handler |
||
80 | * @param HandlerInterface $handler The handler instance to add on |
||
81 | * @return Notifier Returns this |
||
82 | */ |
||
83 | 3 | public function pushHandler(HandlerInterface $handler) { |
|
87 | |||
88 | /** |
||
89 | * Get Notifier |
||
90 | * @return Notifier |
||
91 | */ |
||
92 | 3 | public function getNotifier() |
|
96 | |||
97 | /** |
||
98 | * Set Notifier |
||
99 | * @param Notifier $notifier A Notifier instance to use |
||
100 | */ |
||
101 | 3 | public function setNotifier(Notifier $notifier) |
|
106 | |||
107 | /** |
||
108 | * Set a string or a closure to be called that will generate the message body for the notification |
||
109 | * @param function|string $cb This closure function will be passed an Exception and must return a string |
||
110 | */ |
||
111 | 3 | public function setMessage($cb) |
|
116 | |||
117 | /** |
||
118 | * Set a string or a closure to be called that will generate the subject line for the notification |
||
119 | * @param function|string $cb This closure function will be passed an Exception and must return a string |
||
120 | */ |
||
121 | 3 | public function setSubject($cb) |
|
126 | |||
127 | } |