From ae314346d5dddf07f7dcac956db6160ceae46e8c Mon Sep 17 00:00:00 2001 From: Max Semenik Date: Fri, 27 Jul 2018 20:13:57 -0700 Subject: [PATCH] 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 --- includes/cache/localisation/LocalisationCache.php | 5 +++++ 1 file changed, 5 insertions(+) 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 { -- 2.20.1