From: Max Semenik Date: Sat, 28 Jul 2018 03:13:57 +0000 (-0700) Subject: Enclose compact() call in error suppression X-Git-Tag: 1.34.0-rc.0~4638 X-Git-Url: https://git.cyclocoop.org/%242?a=commitdiff_plain;h=ae314346d5dddf07f7dcac956db6160ceae46e8c;p=lhc%2Fweb%2Fwiklou.git Enclose compact() call in error suppression In PHP 7.3, compact() now emits warnings when a variable doesn't exist. Because our language files aren't required to contain all the possible variables, this results in massive spam trying to run tests. Change-Id: Idab0340ec1cdebfca67cb448e350a408438bcbbc --- diff --git a/includes/cache/localisation/LocalisationCache.php b/includes/cache/localisation/LocalisationCache.php index 90108eb682..9e2a2fd2ca 100644 --- a/includes/cache/localisation/LocalisationCache.php +++ b/includes/cache/localisation/LocalisationCache.php @@ -524,7 +524,12 @@ class LocalisationCache { Wikimedia\restoreWarnings(); if ( $_fileType == 'core' || $_fileType == 'extension' ) { + + // Lnguage files aren't required to contain all the possible variables, so suppress warnings + // when variables don't exist in tests + Wikimedia\suppressWarnings(); $data = compact( self::$allKeys ); + Wikimedia\restoreWarnings(); } elseif ( $_fileType == 'aliases' ) { $data = compact( 'aliases' ); } else {