1 | <?php |
||
14 | class EventHandler |
||
15 | { |
||
16 | /** |
||
17 | * @var \EricMakesStuff\ServerMonitor\Notifications\Notifier |
||
18 | */ |
||
19 | protected $notifier; |
||
20 | |||
21 | public function __construct() |
||
27 | |||
28 | /** |
||
29 | * @param \EricMakesStuff\ServerMonitor\Events\DiskUsageAlarm $event |
||
30 | */ |
||
31 | public function whenDiskUsageAlarm(DiskUsageAlarm $event) |
||
35 | |||
36 | /** |
||
37 | * @param \EricMakesStuff\ServerMonitor\Events\DiskUsageHealthy $event |
||
38 | */ |
||
39 | public function whenDiskUsageHealthy(DiskUsageHealthy $event) |
||
43 | |||
44 | /** |
||
45 | * @param \EricMakesStuff\ServerMonitor\Events\HttpPingDown $event |
||
46 | */ |
||
47 | public function whenHttpPingDown(HttpPingDown $event) |
||
51 | |||
52 | /** |
||
53 | * @param \EricMakesStuff\ServerMonitor\Events\HttpPingUp $event |
||
54 | */ |
||
55 | public function whenHttpPingUp(HttpPingUp $event) |
||
59 | |||
60 | /** |
||
61 | * @param \EricMakesStuff\ServerMonitor\Events\SSLCertificateValid $event |
||
62 | */ |
||
63 | public function whenSSLCertificateValid(SSLCertificateValid $event) |
||
67 | |||
68 | /** |
||
69 | * @param \EricMakesStuff\ServerMonitor\Events\SSLCertificateInvalid $event |
||
70 | */ |
||
71 | public function whenSSLCertificateInvalid(SSLCertificateInvalid $event) |
||
75 | |||
76 | /** |
||
77 | * @param \EricMakesStuff\ServerMonitor\Events\SSLCertificateExpiring $event |
||
78 | */ |
||
79 | public function whenSSLCertificateExpiring(SSLCertificateExpiring $event) |
||
83 | |||
84 | /** |
||
85 | * Register the listeners for the subscriber. |
||
86 | * |
||
87 | * @param \Illuminate\Events\Dispatcher $events |
||
88 | * |
||
89 | * @return array |
||
90 | */ |
||
91 | public function subscribe(Dispatcher $events) |
||
128 | } |
||
129 |
Unless you are absolutely sure that the expression can never be null because of other conditions, we strongly recommend to add an additional type check to your code: