| Conditions | 3 |
| Paths | 1 |
| Total Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 3.0123 |
| Changes | 0 | ||
| 1 | <?php |
||
| 11 | 5 | public function register() |
|
| 12 | { |
||
| 13 | app(QueueManager::class)->failing(function (JobFailed $event) { |
||
| 14 | 5 | $notifiable = app(config('throttled-failed-jobs.notifiable')); |
|
| 15 | |||
| 16 | 5 | $notification = app(config('throttled-failed-jobs.notification'))->setEvent($event); |
|
| 17 | |||
| 18 | 5 | if (! $this->isValidNotificationClass($notification)) { |
|
| 19 | throw InvalidConfiguration::notificationClassInvalid(get_class($notification)); |
||
| 20 | } |
||
| 21 | |||
| 22 | 5 | if ($this->shouldSendNotification($notification)) { |
|
| 23 | 5 | $notifiable->notify($notification); |
|
| 24 | } |
||
| 25 | 5 | }); |
|
| 26 | 5 | } |
|
| 27 | |||
| 52 |