diff --git a/src/sentry/src/Tracing/Listener/TracingCrontabListener.php b/src/sentry/src/Tracing/Listener/TracingCrontabListener.php index 0c74adc70..b9c53bc27 100644 --- a/src/sentry/src/Tracing/Listener/TracingCrontabListener.php +++ b/src/sentry/src/Tracing/Listener/TracingCrontabListener.php @@ -35,9 +35,9 @@ public function __construct( public function listen(): array { return [ - BeforeExecute::class, // @phpstan-ignore-line + BeforeExecute::class, FailToExecute::class, - AfterExecute::class, // @phpstan-ignore-line + AfterExecute::class, ]; } @@ -47,12 +47,12 @@ public function listen(): array public function process(object $event): void { match ($event::class) { - BeforeExecute::class => $this->startTransaction($event), // @phpstan-ignore-line - AfterExecute::class => $this->finishTransaction($event), // @phpstan-ignore-line + BeforeExecute::class => $this->startTransaction($event), + AfterExecute::class, FailToExecute::class => $this->finishTransaction($event), }; } - protected function startTransaction(BeforeExecute $event): void // @phpstan-ignore-line + protected function startTransaction(BeforeExecute $event): void { $sentry = SentrySdk::init(); /** @var Crontab $crontab */ @@ -93,7 +93,7 @@ protected function startTransaction(BeforeExecute $event): void // @phpstan-igno TraceContext::setSpan($transaction); } - protected function finishTransaction(AfterExecute|FailToExecute $event): void // @phpstan-ignore-line + protected function finishTransaction(AfterExecute|FailToExecute $event): void { $transaction = TraceContext::getTransaction();