X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FHistoryBlob.php;h=bca6c7e5bc5f3cac6edecebf60b1af78f54c4297;hb=6c7c8ff8dc746422f901a972ecfd1bda4787cd77;hp=075b48d225509bb95a2bc0a64a2272a353313f5f;hpb=095a2a05b2aaccff26d7b871194a4edccd092707;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/HistoryBlob.php b/includes/HistoryBlob.php index 075b48d225..bca6c7e5bc 100644 --- a/includes/HistoryBlob.php +++ b/includes/HistoryBlob.php @@ -445,8 +445,7 @@ class DiffHistoryBlob implements HistoryBlob { // Already compressed return; } - if ( !count( $this->mItems ) ) { - // Empty + if ( $this->mItems === [] ) { return; } @@ -492,7 +491,7 @@ class DiffHistoryBlob implements HistoryBlob { $this->mDiffs = []; $this->mDiffMap = []; foreach ( $sequences as $seq ) { - if ( !count( $seq['diffs'] ) ) { + if ( $seq['diffs'] === [] ) { continue; } if ( $tail === '' ) { @@ -519,9 +518,9 @@ class DiffHistoryBlob implements HistoryBlob { function diff( $t1, $t2 ) { # Need to do a null concatenation with warnings off, due to bugs in the current version of xdiff # "String is not zero-terminated" - MediaWiki\suppressWarnings(); + Wikimedia\suppressWarnings(); $diff = xdiff_string_rabdiff( $t1, $t2 ) . ''; - MediaWiki\restoreWarnings(); + Wikimedia\restoreWarnings(); return $diff; } @@ -532,9 +531,9 @@ class DiffHistoryBlob implements HistoryBlob { */ function patch( $base, $diff ) { if ( function_exists( 'xdiff_string_bpatch' ) ) { - MediaWiki\suppressWarnings(); + Wikimedia\suppressWarnings(); $text = xdiff_string_bpatch( $base, $diff ) . ''; - MediaWiki\restoreWarnings(); + Wikimedia\restoreWarnings(); return $text; } @@ -627,8 +626,7 @@ class DiffHistoryBlob implements HistoryBlob { */ function __sleep() { $this->compress(); - if ( !count( $this->mItems ) ) { - // Empty object + if ( $this->mItems === [] ) { $info = false; } else { // Take forward differences to improve the compression ratio for sequences @@ -707,7 +705,7 @@ if ( false ) { // autoload entries for the lowercase variants of these classes (T166759). // The code below is never executed, but it is picked up by the AutoloadGenerator // parser, which scans for class_alias() calls. - class_alias( 'ConcatenatedGzipHistoryBlob', 'concatenatedgziphistoryblob' ); - class_alias( 'HistoryBlobCurStub', 'historyblobcurstub' ); - class_alias( 'HistoryBlobStub', 'historyblobstub' ); + class_alias( ConcatenatedGzipHistoryBlob::class, 'concatenatedgziphistoryblob' ); + class_alias( HistoryBlobCurStub::class, 'historyblobcurstub' ); + class_alias( HistoryBlobStub::class, 'historyblobstub' ); }