| Conditions | 3 |
| Paths | 3 |
| Total Lines | 16 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 11 |
| CRAP Score | 3 |
| Changes | 6 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 34 | 4 | public function send($notifiable, Notification $notification) |
|
| 35 | { |
||
| 36 | 4 | if (! $pushoverKey = $notifiable->routeNotificationFor('pushover')) { |
|
| 37 | 1 | return; |
|
| 38 | } |
||
| 39 | |||
| 40 | 3 | $message = $notification->toPushover($notifiable); |
|
| 41 | |||
| 42 | try { |
||
| 43 | 3 | $this->pushover->send(array_merge($message->toArray(), [ |
|
| 44 | 3 | 'user' => $pushoverKey, |
|
| 45 | 3 | ])); |
|
| 46 | 3 | } catch (ServiceCommunicationError $serviceCommunicationError) { |
|
| 47 | 3 | $this->fireFailedEvent($notifiable, $notification, $serviceCommunicationError->getMessage()); |
|
| 48 | 3 | } |
|
| 49 | 3 | } |
|
| 50 | 3 | ||
| 58 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: