}
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;