From 5c9389db152083bb2c0bc4267c4ca9016ce95578 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartosz=20Dziewo=C5=84ski?= Date: Mon, 16 Dec 2024 16:41:02 +0100 Subject: [PATCH] Replace unneeded `isset()` with `!== null` The PHP `global` statement actually creates a global variable if it does not exist yet, setting it to null. Who'd have thunk. This is reported as a new issue type 'MediaWikiNoIssetIfDefined' by mediawiki/mediawiki-phan-config to 0.15.0. Change-Id: Ia1c3a08f399257ede41920beafa9f1864206c94e --- includes/Notifications/EventDispatcher.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/Notifications/EventDispatcher.php b/includes/Notifications/EventDispatcher.php index 1fc4a2f98..e496fe53e 100644 --- a/includes/Notifications/EventDispatcher.php +++ b/includes/Notifications/EventDispatcher.php @@ -493,10 +493,10 @@ class EventDispatcher { global $wgDTSchemaEditAttemptStepSamplingRate, $wgWMESchemaEditAttemptStepSamplingRate; // Sample 6.25% $samplingRate = 0.0625; - if ( isset( $wgDTSchemaEditAttemptStepSamplingRate ) ) { + if ( $wgDTSchemaEditAttemptStepSamplingRate !== null ) { $samplingRate = $wgDTSchemaEditAttemptStepSamplingRate; } - if ( isset( $wgWMESchemaEditAttemptStepSamplingRate ) ) { + if ( $wgWMESchemaEditAttemptStepSamplingRate !== null ) { $samplingRate = $wgWMESchemaEditAttemptStepSamplingRate; } if ( $samplingRate === 0 ) {