GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Pull Request — master (#12)
by
unknown
06:21 queued 47s
created

FailedJobNotifier::getChannelInstance()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 1
1
<?php
2
3
namespace Spatie\FailedJobMonitor;
4
5
use Illuminate\Queue\QueueManager;
6
use Illuminate\Queue\Events\JobFailed;
7
use Spatie\FailedJobMonitor\Exceptions\InvalidNotificationException;
8
9
class FailedJobNotifier
10
{
11
    public function register()
12
    {
13
        app(QueueManager::class)->failing(function (JobFailed $event) {
14
            $notifiable = app(config('laravel-failed-job-monitor.notifiable'));
15
            $notification = app(config('laravel-failed-job-monitor.notification'))->setEvent($event);
16
17
            if (! $this->isValidNotificationClass($notification)) {
18
                throw new InvalidNotificationException(
19
                    "Class {get_class($notification)} must extend ".Notification::class
20
                );
21
            }
22
23
            $notifiable->notify($notification);
24
        });
25
    }
26
27
    public function isValidNotificationClass($notification):bool
28
    {
29
        return get_class($notification) === Notification::class || is_subclass_of($notification, Notification::class);
30
    }
31
}
32