X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2Fbenchmarks%2Fbench_wfIsWindows.php;h=960ef0e8eecafb87e29114e5d707cb65b5e1f74f;hb=e7f6fc6d6f2306ec9b07e736088f3fd420c70681;hp=8446694ba3e887e540325934fcc21ec2e071037c;hpb=27f8aa732e55f0655255152fa22655fa07424c2d;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/benchmarks/bench_wfIsWindows.php b/maintenance/benchmarks/bench_wfIsWindows.php index 8446694ba3..960ef0e8ee 100644 --- a/maintenance/benchmarks/bench_wfIsWindows.php +++ b/maintenance/benchmarks/bench_wfIsWindows.php @@ -34,28 +34,27 @@ require_once __DIR__ . '/Benchmarker.php'; class BenchWfIsWindows extends Benchmarker { public function __construct() { parent::__construct(); - $this->mDescription = "Benchmark for wfIsWindows."; + $this->addDescription( 'Benchmark for wfIsWindows.' ); } public function execute() { - $this->bench( array( - array( 'function' => array( $this, 'wfIsWindows' ) ), - array( 'function' => array( $this, 'wfIsWindowsCached' ) ), - ) ); - print $this->getFormattedResults(); + $this->bench( [ + [ 'function' => [ $this, 'wfIsWindows' ] ], + [ 'function' => [ $this, 'wfIsWindowsCached' ] ], + ] ); } - static function is_win() { + protected static function is_win() { return substr( php_uname(), 0, 7 ) == 'Windows'; } // bench function 1 - function wfIsWindows() { + protected function wfIsWindows() { return self::is_win(); } // bench function 2 - function wfIsWindowsCached() { + protected function wfIsWindowsCached() { static $isWindows = null; if ( $isWindows == null ) { $isWindows = self::is_win();