@@ -252,7 +252,7 @@ function startTransaction(TransactionContext $context, array $customSamplingCont
252252 */
253253function trace (callable $ trace , SpanContext $ context )
254254{
255- return SentrySdk::getCurrentHub ()->withScope (function (Scope $ scope ) use ($ context , $ trace ) {
255+ return SentrySdk::getCurrentHub ()->withScope (static function (Scope $ scope ) use ($ context , $ trace ) {
256256 $ parentSpan = $ scope ->getSpan ();
257257
258258 // If there is a span set on the scope and it's sampled there is an active transaction.
@@ -299,7 +299,7 @@ function getTraceparent(): string
299299 }
300300
301301 $ traceParent = '' ;
302- $ hub ->configureScope (function (Scope $ scope ) use (&$ traceParent ) {
302+ $ hub ->configureScope (static function (Scope $ scope ) use (&$ traceParent ) {
303303 $ traceParent = $ scope ->getPropagationContext ()->toTraceparent ();
304304 });
305305
@@ -342,7 +342,7 @@ function getBaggage(): string
342342 }
343343
344344 $ baggage = '' ;
345- $ hub ->configureScope (function (Scope $ scope ) use (&$ baggage ) {
345+ $ hub ->configureScope (static function (Scope $ scope ) use (&$ baggage ) {
346346 $ baggage = $ scope ->getPropagationContext ()->toBaggage ();
347347 });
348348
@@ -358,7 +358,7 @@ function getBaggage(): string
358358function continueTrace (string $ sentryTrace , string $ baggage ): TransactionContext
359359{
360360 $ hub = SentrySdk::getCurrentHub ();
361- $ hub ->configureScope (function (Scope $ scope ) use ($ sentryTrace , $ baggage ) {
361+ $ hub ->configureScope (static function (Scope $ scope ) use ($ sentryTrace , $ baggage ) {
362362 $ propagationContext = PropagationContext::fromHeaders ($ sentryTrace , $ baggage );
363363 $ scope ->setPropagationContext ($ propagationContext );
364364 });
@@ -393,7 +393,7 @@ function trace_metrics(): TraceMetrics
393393 */
394394function addFeatureFlag (string $ name , bool $ result ): void
395395{
396- SentrySdk::getCurrentHub ()->configureScope (function (Scope $ scope ) use ($ name , $ result ) {
396+ SentrySdk::getCurrentHub ()->configureScope (static function (Scope $ scope ) use ($ name , $ result ) {
397397 $ scope ->addFeatureFlag ($ name , $ result );
398398 });
399399}
0 commit comments