1 | <?php |
||
11 | class EventHandler |
||
12 | { |
||
13 | /** |
||
14 | * @var \EricMakesStuff\ServerMonitor\Notifications\Notifier |
||
15 | */ |
||
16 | protected $notifier; |
||
17 | |||
18 | public function __construct() |
||
24 | |||
25 | /** |
||
26 | * @param \EricMakesStuff\ServerMonitor\Events\DiskUsageAlarm $event |
||
27 | */ |
||
28 | public function whenDiskUsageAlarm(DiskUsageAlarm $event) |
||
32 | |||
33 | /** |
||
34 | * @param \EricMakesStuff\ServerMonitor\Events\DiskUsageHealthy $event |
||
35 | */ |
||
36 | public function whenDiskUsageHealthy(DiskUsageHealthy $event) |
||
40 | |||
41 | /** |
||
42 | * @param \EricMakesStuff\ServerMonitor\Events\HttpPingDown $event |
||
43 | */ |
||
44 | public function whenHttpPingDown(HttpPingDown $event) |
||
48 | |||
49 | /** |
||
50 | * @param \EricMakesStuff\ServerMonitor\Events\HttpPingUp $event |
||
51 | */ |
||
52 | public function whenHttpPingUp(HttpPingUp $event) |
||
56 | |||
57 | /** |
||
58 | * Register the listeners for the subscriber. |
||
59 | * |
||
60 | * @param \Illuminate\Events\Dispatcher $events |
||
61 | * |
||
62 | * @return array |
||
63 | */ |
||
64 | public function subscribe(Dispatcher $events) |
||
86 | } |
||
87 |
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: