Merge "HISTORY: Add MediaWiki 1.18 post-release change notes"
[lhc/web/wiklou.git] / includes / HistoryBlob.php
index 075b48d..bca6c7e 100644 (file)
@@ -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' );
 }