honeybadger-io /
honeybadger-laravel
| 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
Loading history...
|
|||||
| 20 | 'job' => get_class($event->job), |
||||
|
0 ignored issues
–
show
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
Loading history...
|
|||||
| 21 | ]; |
||||
| 22 | |||||
| 23 | Honeybadger::addBreadcrumb('Job queued', $metadata, 'job'); |
||||
| 24 | } |
||||
| 25 | } |
||||
| 26 |