diff options
author | Umherirrender <umherirrender_de.wp@web.de> | 2024-12-19 18:33:17 +0100 |
---|---|---|
committer | Umherirrender <umherirrender_de.wp@web.de> | 2024-12-19 18:33:17 +0100 |
commit | 5d5a81a4b9bf3f3cb110d13abdd9cddfa9b2f462 (patch) | |
tree | d3becdf4def17bca61a0dcaceaac9ccae9ae18f7 /includes/historyblob | |
parent | 1471c51a0076854148fde8e4dcb37ff8feefecc7 (diff) | |
download | mediawikicore-5d5a81a4b9bf3f3cb110d13abdd9cddfa9b2f462.tar.gz mediawikicore-5d5a81a4b9bf3f3cb110d13abdd9cddfa9b2f462.zip |
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
Diffstat (limited to 'includes/historyblob')
-rw-r--r-- | includes/historyblob/DiffHistoryBlob.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/includes/historyblob/DiffHistoryBlob.php b/includes/historyblob/DiffHistoryBlob.php index b1ce7f443d88..23453dffcd18 100644 --- a/includes/historyblob/DiffHistoryBlob.php +++ b/includes/historyblob/DiffHistoryBlob.php @@ -47,7 +47,7 @@ class DiffHistoryBlob implements HistoryBlob { /** @var array The diff map, see above */ public $mDiffMap; - /** @var string The key for getText() + /** @var string|null The key for getText() */ public $mDefaultKey; @@ -118,7 +118,7 @@ class DiffHistoryBlob implements HistoryBlob { if ( !function_exists( 'xdiff_string_rabdiff' ) ) { throw new RuntimeException( "Need xdiff support to write DiffHistoryBlob\n" ); } - if ( isset( $this->mDiffs ) ) { + if ( $this->mDiffs !== null ) { // Already compressed return; } @@ -306,7 +306,7 @@ class DiffHistoryBlob implements HistoryBlob { 'map' => $map ]; } - if ( isset( $this->mDefaultKey ) ) { + if ( $this->mDefaultKey !== null ) { $info['default'] = $this->mDefaultKey; } $this->mCompressed = gzdeflate( serialize( $info ) ); |