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.

JobQueued   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 1
eloc 7
c 2
b 0
f 0
dl 0
loc 13
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A handleEvent() 0 9 1
1
<?php
2
3
namespace Honeybadger\HoneybadgerLaravel\Breadcrumbs;
4
5
use Honeybadger\HoneybadgerLaravel\Facades\Honeybadger;
6
use Illuminate\Queue\Events\JobQueued as LaravelJobQueued;
7
8
/**
9
 * The JobQueued event was introduced in Laravel 8.24, so this won't work on lower versions.
10
 */
11
class JobQueued extends Breadcrumb
12
{
13
    public $handles = LaravelJobQueued::class;
14
15
    public function handleEvent(LaravelJobQueued $event)
16
    {
17
        $metadata = [
18
            'connectionName' => $event->connectionName,
19
            'queue' => $event->job->queue,
0 ignored issues
show
Bug introduced by
The property queue does not seem to exist on Closure.
Loading history...
20
            'job' => get_class($event->job),
0 ignored issues
show
Bug introduced by
It seems like $event->job can also be of type string; however, parameter $object of get_class() does only seem to accept object, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

20
            'job' => get_class(/** @scrutinizer ignore-type */ $event->job),
Loading history...
21
        ];
22
23
        Honeybadger::addBreadcrumb('Job queued', $metadata, 'job');
24
    }
25
}
26