From 5d5a81a4b9bf3f3cb110d13abdd9cddfa9b2f462 Mon Sep 17 00:00:00 2001 From: Umherirrender Date: Thu, 19 Dec 2024 18:33:17 +0100 Subject: Replace isset() with null checks isset() should only be used to suppress errors, not for null check. When the property is always defined, there is no need to use isset. Found by a new phan plugin (2efea9f989) https://www.mediawiki.org/wiki/Manual:Coding_conventions/PHP#isset Change-Id: Ib84b7d71e8308a36409f30ecfd16e9de149e97b3 --- includes/http/Telemetry.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'includes/http') diff --git a/includes/http/Telemetry.php b/includes/http/Telemetry.php index f4c80b44efa9..ba5db1c6f66e 100644 --- a/includes/http/Telemetry.php +++ b/includes/http/Telemetry.php @@ -76,7 +76,7 @@ class Telemetry implements TelemetryHeadersInterface { */ public function getRequestId(): string { // This method is called from various error handlers and MUST be kept simple and stateless. - if ( !isset( $this->reqId ) ) { + if ( $this->reqId === null ) { if ( $this->allowExternalReqID ) { $id = ( $this->server['HTTP_X_REQUEST_ID'] ?? $this->server['UNIQUE_ID'] ?? wfRandomString( 24 ) ); } else { -- cgit v1.2.3