diff --git a/src/sentry/src/Tracing/Aspect/CoroutineAspect.php b/src/sentry/src/Tracing/Aspect/CoroutineAspect.php index 0b638e2f3..3f1f20c80 100644 --- a/src/sentry/src/Tracing/Aspect/CoroutineAspect.php +++ b/src/sentry/src/Tracing/Aspect/CoroutineAspect.php @@ -61,7 +61,7 @@ public function process(ProceedingJoinPoint $proceedingJoinPoint) $transaction = SentrySdk::getCurrentHub()->getTransaction(); // If there's no active transaction, skip tracing. - if (! $transaction || ! $transaction->getSampled()) { + if (! $transaction?->getSampled()) { return $proceedingJoinPoint->process(); } diff --git a/src/sentry/src/Tracing/Listener/EventHandleListener.php b/src/sentry/src/Tracing/Listener/EventHandleListener.php index 4bea5f9f5..1f56f55cc 100644 --- a/src/sentry/src/Tracing/Listener/EventHandleListener.php +++ b/src/sentry/src/Tracing/Listener/EventHandleListener.php @@ -404,7 +404,7 @@ protected function handleCommandFinished(CommandEvent\AfterExecute $event): void { $transaction = SentrySdk::getCurrentHub()->getTransaction(); - if (! $transaction || ! $transaction->getSampled()) { + if (! $transaction?->getSampled()) { return; } @@ -517,7 +517,7 @@ protected function handleCrontabTaskFinished(CrontabEvent\FailToExecute|CrontabE { $transaction = SentrySdk::getCurrentHub()->getTransaction(); - if (! $transaction || ! $transaction->getSampled()) { + if (! $transaction?->getSampled()) { return; } @@ -585,7 +585,7 @@ protected function handleAmqpMessageProcessed(AmqpEvent\AfterConsume|AmqpEvent\F { $transaction = SentrySdk::getCurrentHub()->getTransaction(); - if (! $transaction || ! $transaction->getSampled()) { + if (! $transaction?->getSampled()) { return; } @@ -653,7 +653,7 @@ protected function handleKafkaMessageProcessed(KafkaEvent\AfterConsume|KafkaEven { $transaction = SentrySdk::getCurrentHub()->getTransaction(); - if (! $transaction || ! $transaction->getSampled()) { + if (! $transaction?->getSampled()) { return; } @@ -704,7 +704,7 @@ protected function handleAsyncQueueJobProcessed(AsyncQueueEvent\AfterHandle|Asyn { $transaction = SentrySdk::getCurrentHub()->getTransaction(); - if (! $transaction || ! $transaction->getSampled()) { + if (! $transaction?->getSampled()) { return; }