@@ -224,15 +224,15 @@ public function testWithMonitor(): void
224224 $ hub ->expects ($ this ->exactly (2 ))
225225 ->method ('captureCheckIn ' )
226226 ->with (
227- $ this ->callback (function (string $ slug ): bool {
227+ $ this ->callback (static function (string $ slug ): bool {
228228 return $ slug === 'test-crontab ' ;
229229 }),
230- $ this ->callback (function (CheckInStatus $ checkInStatus ): bool {
230+ $ this ->callback (static function (CheckInStatus $ checkInStatus ): bool {
231231 // just check for type CheckInStatus
232232 return true ;
233233 }),
234234 $ this ->anything (),
235- $ this ->callback (function (MonitorConfig $ monitorConfig ): bool {
235+ $ this ->callback (static function (MonitorConfig $ monitorConfig ): bool {
236236 return $ monitorConfig ->getSchedule ()->getValue () === '*/5 * * * * '
237237 && $ monitorConfig ->getSchedule ()->getType () === MonitorSchedule::TYPE_CRONTAB
238238 && $ monitorConfig ->getCheckinMargin () === 5
@@ -243,7 +243,7 @@ public function testWithMonitor(): void
243243
244244 SentrySdk::setCurrentHub ($ hub );
245245
246- withMonitor ('test-crontab ' , function () {
246+ withMonitor ('test-crontab ' , static function () {
247247 // Do something...
248248 }, new MonitorConfig (
249249 new MonitorSchedule (MonitorSchedule::TYPE_CRONTAB , '*/5 * * * * ' ),
@@ -261,15 +261,15 @@ public function testWithMonitorCallableThrows(): void
261261 $ hub ->expects ($ this ->exactly (2 ))
262262 ->method ('captureCheckIn ' )
263263 ->with (
264- $ this ->callback (function (string $ slug ): bool {
264+ $ this ->callback (static function (string $ slug ): bool {
265265 return $ slug === 'test-crontab ' ;
266266 }),
267- $ this ->callback (function (CheckInStatus $ checkInStatus ): bool {
267+ $ this ->callback (static function (CheckInStatus $ checkInStatus ): bool {
268268 // just check for type CheckInStatus
269269 return true ;
270270 }),
271271 $ this ->anything (),
272- $ this ->callback (function (MonitorConfig $ monitorConfig ): bool {
272+ $ this ->callback (static function (MonitorConfig $ monitorConfig ): bool {
273273 return $ monitorConfig ->getSchedule ()->getValue () === '*/5 * * * * '
274274 && $ monitorConfig ->getSchedule ()->getType () === MonitorSchedule::TYPE_CRONTAB
275275 && $ monitorConfig ->getCheckinMargin () === 5
@@ -280,7 +280,7 @@ public function testWithMonitorCallableThrows(): void
280280
281281 SentrySdk::setCurrentHub ($ hub );
282282
283- withMonitor ('test-crontab ' , function () {
283+ withMonitor ('test-crontab ' , static function () {
284284 throw new \Exception ();
285285 }, new MonitorConfig (
286286 new MonitorSchedule (MonitorSchedule::TYPE_CRONTAB , '*/5 * * * * ' ),
@@ -352,7 +352,7 @@ public function testTraceReturnsClosureResult(): void
352352 {
353353 $ returnValue = 'foo ' ;
354354
355- $ result = trace (function () use ($ returnValue ) {
355+ $ result = trace (static function () use ($ returnValue ) {
356356 return $ returnValue ;
357357 }, new SpanContext ());
358358
@@ -379,7 +379,7 @@ public function testTraceCorrectlyReplacesAndRestoresCurrentSpan(): void
379379 $ this ->assertSame ($ transaction , $ hub ->getSpan ());
380380
381381 try {
382- trace (function () {
382+ trace (static function () {
383383 throw new \RuntimeException ('Throwing should still restore the previous span ' );
384384 }, new SpanContext ());
385385 } catch (\RuntimeException $ e ) {
0 commit comments