Use suppress/restoreWarnings()
authorSiebrand Mazeland <s.mazeland@xs4all.nl>
Mon, 11 Nov 2013 15:49:37 +0000 (16:49 +0100)
committerSiebrand <siebrand@wikimedia.org>
Mon, 11 Nov 2013 16:00:10 +0000 (16:00 +0000)
Instead of @

Change-Id: I0c422e452636ae1af664b24c0859d038592e0e8a

maintenance/language/StatOutputs.php

index e102a3c..f7c9787 100644 (file)
@@ -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.