X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=maintenance%2Fbenchmarks%2Fbench_wfIsWindows.php;h=960ef0e8eecafb87e29114e5d707cb65b5e1f74f;hp=ea919eface3b8c2d7b2f669444d6e95b012979d3;hb=f7e1770fb832aa77bf4e16ce8cc815f2b24dd10d;hpb=995449ef039b769a613ddf3731ece1e4c20d358c diff --git a/maintenance/benchmarks/bench_wfIsWindows.php b/maintenance/benchmarks/bench_wfIsWindows.php index ea919eface..960ef0e8ee 100644 --- a/maintenance/benchmarks/bench_wfIsWindows.php +++ b/maintenance/benchmarks/bench_wfIsWindows.php @@ -38,24 +38,23 @@ class BenchWfIsWindows extends Benchmarker { } 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();