Merge "Rewrite pref cleanup script"
[lhc/web/wiklou.git] / maintenance / benchmarks / bench_HTTP_HTTPS.php
index 40a877f..5e1feb7 100644 (file)
@@ -38,27 +38,26 @@ class BenchHttpHttps extends Benchmarker {
        }
 
        public function execute() {
-               $this->bench( array(
-                       array( 'function' => array( $this, 'getHTTP' ) ),
-                       array( 'function' => array( $this, 'getHTTPS' ) ),
-               ) );
-               print $this->getFormattedResults();
+               $this->bench( [
+                       [ 'function' => [ $this, 'getHTTP' ] ],
+                       [ 'function' => [ $this, 'getHTTPS' ] ],
+               ] );
        }
 
-       static function doRequest( $proto ) {
-               Http::get( "$proto://localhost/", array(), __METHOD__ );
+       private function doRequest( $proto ) {
+               Http::get( "$proto://localhost/", [], __METHOD__ );
        }
 
        // bench function 1
-       function getHTTP() {
+       protected function getHTTP() {
                $this->doRequest( 'http' );
        }
 
        // bench function 2
-       function getHTTPS() {
+       protected function getHTTPS() {
                $this->doRequest( 'https' );
        }
 }
 
-$maintClass = 'BenchHttpHttps';
+$maintClass = BenchHttpHttps::class;
 require_once RUN_MAINTENANCE_IF_MAIN;