Skip to content

Commit

Permalink
Introduce helper to integrate Sentry using first class callbale syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
stayallive committed Feb 1, 2024
1 parent a314a47 commit 367bbb3
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/Sentry/Laravel/Integration.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\LazyLoadingViolationException;
use Illuminate\Foundation\Configuration\Exceptions;
use Illuminate\Routing\Route;
use Sentry\EventHint;
use Sentry\EventId;
Expand Down Expand Up @@ -52,6 +53,16 @@ public function setupOnce(): void
});
}

/**
* Convienence method to register the exception handler with Laravel 11+.
*/
public static function handles(Exceptions $exceptions): void

Check failure on line 59 in src/Sentry/Laravel/Integration.php

View workflow job for this annotation

GitHub Actions / PHPStan

Parameter $exceptions of method Sentry\Laravel\Integration::handles() has invalid type Illuminate\Foundation\Configuration\Exceptions.
{
$exceptions->reportable(static function (Throwable $throwable) {
self::captureUnhandledException($throwable);
});
}

/**
* Adds a breadcrumb if the integration is enabled for Laravel.
*
Expand Down

0 comments on commit 367bbb3

Please sign in to comment.