From f962c5db6407addfb5232b0acf58cf17543b0575 Mon Sep 17 00:00:00 2001 From: Siebrand Mazeland Date: Mon, 11 Nov 2013 16:49:37 +0100 Subject: [PATCH] Use suppress/restoreWarnings() Instead of @ Change-Id: I0c422e452636ae1af664b24c0859d038592e0e8a --- maintenance/language/StatOutputs.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/maintenance/language/StatOutputs.php b/maintenance/language/StatOutputs.php index e102a3c409..f7c978732b 100644 --- a/maintenance/language/StatOutputs.php +++ b/maintenance/language/StatOutputs.php @@ -29,7 +29,10 @@ if ( !defined( 'MEDIAWIKI' ) ) { /** A general output object. Need to be overriden */ class statsOutput { function formatPercent( $subset, $total, $revert = false, $accuracy = 2 ) { - return @sprintf( '%.' . $accuracy . 'f%%', 100 * $subset / $total ); + wfSuppressWarnings(); + $return = sprintf( '%.' . $accuracy . 'f%%', 100 * $subset / $total ); + wfRestoreWarnings(); + return $return; } # Override the following methods @@ -86,7 +89,10 @@ class wikiStatsOutput extends statsOutput { } function formatPercent( $subset, $total, $revert = false, $accuracy = 2 ) { - $v = @round( 255 * $subset / $total ); + wfSuppressWarnings(); + $v = round( 255 * $subset / $total ); + wfRestoreWarnings(); + if ( $revert ) { # Weigh reverse with factor 20 so coloring takes effect more quickly as # this option is used solely for reporting 'bad' percentages. -- 2.20.1