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
This commit is contained in:
Bartosz Dziewoński 2024-12-16 16:41:02 +01:00
parent cfdd9b1a48
commit 5c9389db15

View file

@ -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 ) {