Siebrand has uploaded a new change for review. https://gerrit.wikimedia.org/r/129022
Change subject: Pass phpcs-strict on maintenance/benchmarks/ ...................................................................... Pass phpcs-strict on maintenance/benchmarks/ Change-Id: I73558930909b35bbc13d0a0ac9368485cb2aa8c4 --- M maintenance/benchmarks/bench_HTTP_HTTPS.php M maintenance/benchmarks/bench_delete_truncate.php M maintenance/benchmarks/bench_if_switch.php M maintenance/benchmarks/bench_strtr_str_replace.php M maintenance/benchmarks/bench_utf8_title_check.php M maintenance/benchmarks/bench_wfBaseConvert.php M maintenance/benchmarks/bench_wfIsWindows.php M maintenance/benchmarks/benchmarkHooks.php M maintenance/benchmarks/benchmarkPurge.php 9 files changed, 67 insertions(+), 59 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/22/129022/1 diff --git a/maintenance/benchmarks/bench_HTTP_HTTPS.php b/maintenance/benchmarks/bench_HTTP_HTTPS.php index 6f800fb..bb7499b 100644 --- a/maintenance/benchmarks/bench_HTTP_HTTPS.php +++ b/maintenance/benchmarks/bench_HTTP_HTTPS.php @@ -31,8 +31,7 @@ * * @ingroup Benchmark */ -class bench_HTTP_HTTPS extends Benchmarker { - +class BenchHttpHttps extends Benchmarker { public function __construct() { parent::__construct(); $this->mDescription = "Benchmark HTTP request vs HTTPS request."; @@ -42,7 +41,7 @@ $this->bench( array( array( 'function' => array( $this, 'getHTTP' ) ), array( 'function' => array( $this, 'getHTTPS' ) ), - )); + ) ); print $this->getFormattedResults(); } @@ -61,5 +60,5 @@ } } -$maintClass = 'bench_HTTP_HTTPS'; +$maintClass = 'BenchHttpHttps'; require_once RUN_MAINTENANCE_IF_MAIN; diff --git a/maintenance/benchmarks/bench_delete_truncate.php b/maintenance/benchmarks/bench_delete_truncate.php index ea22b6d..ed3fe5c 100644 --- a/maintenance/benchmarks/bench_delete_truncate.php +++ b/maintenance/benchmarks/bench_delete_truncate.php @@ -29,7 +29,6 @@ * @ingroup Benchmark */ class BenchmarkDeleteTruncate extends Benchmarker { - public function __construct() { parent::__construct(); $this->mDescription = "Benchmarks SQL DELETE vs SQL TRUNCATE."; diff --git a/maintenance/benchmarks/bench_if_switch.php b/maintenance/benchmarks/bench_if_switch.php index 80fd962..698a0f0 100644 --- a/maintenance/benchmarks/bench_if_switch.php +++ b/maintenance/benchmarks/bench_if_switch.php @@ -31,8 +31,7 @@ * * @ingroup Maintenance */ -class bench_if_switch extends Benchmarker { - +class BenchIfSwitch extends Benchmarker { public function __construct() { parent::__construct(); $this->mDescription = "Benchmark if elseif... versus switch case."; @@ -42,55 +41,71 @@ $this->bench( array( array( 'function' => array( $this, 'doElseIf' ) ), array( 'function' => array( $this, 'doSwitch' ) ), - )); + ) ); print $this->getFormattedResults(); } // bench function 1 function doElseIf() { $a = 'z'; - if( $a == 'a') {} - elseif( $a == 'b') {} - elseif( $a == 'c') {} - elseif( $a == 'd') {} - elseif( $a == 'e') {} - elseif( $a == 'f') {} - elseif( $a == 'g') {} - elseif( $a == 'h') {} - elseif( $a == 'i') {} - elseif( $a == 'j') {} - elseif( $a == 'k') {} - elseif( $a == 'l') {} - elseif( $a == 'm') {} - elseif( $a == 'n') {} - elseif( $a == 'o') {} - elseif( $a == 'p') {} - else {} + if ( $a == 'a' ) { + } elseif ( $a == 'b' ) { + } elseif ( $a == 'c' ) { + } elseif ( $a == 'd' ) { + } elseif ( $a == 'e' ) { + } elseif ( $a == 'f' ) { + } elseif ( $a == 'g' ) { + } elseif ( $a == 'h' ) { + } elseif ( $a == 'i' ) { + } elseif ( $a == 'j' ) { + } elseif ( $a == 'k' ) { + } elseif ( $a == 'l' ) { + } elseif ( $a == 'm' ) { + } elseif ( $a == 'n' ) { + } elseif ( $a == 'o' ) { + } elseif ( $a == 'p' ) { + } else { + } } // bench function 2 function doSwitch() { $a = 'z'; - switch( $a ) { - case 'b': break; - case 'c': break; - case 'd': break; - case 'e': break; - case 'f': break; - case 'g': break; - case 'h': break; - case 'i': break; - case 'j': break; - case 'k': break; - case 'l': break; - case 'm': break; - case 'n': break; - case 'o': break; - case 'p': break; + switch ( $a ) { + case 'b': + break; + case 'c': + break; + case 'd': + break; + case 'e': + break; + case 'f': + break; + case 'g': + break; + case 'h': + break; + case 'i': + break; + case 'j': + break; + case 'k': + break; + case 'l': + break; + case 'm': + break; + case 'n': + break; + case 'o': + break; + case 'p': + break; default: } } } -$maintClass = 'bench_if_switch'; +$maintClass = 'BenchIfSwitch'; require_once RUN_MAINTENANCE_IF_MAIN; diff --git a/maintenance/benchmarks/bench_strtr_str_replace.php b/maintenance/benchmarks/bench_strtr_str_replace.php index 76b5e3c..99e9cfd 100644 --- a/maintenance/benchmarks/bench_strtr_str_replace.php +++ b/maintenance/benchmarks/bench_strtr_str_replace.php @@ -38,8 +38,7 @@ * * @ingroup Benchmark */ -class bench_strtr_str_replace extends Benchmarker { - +class BenchStrtrStrReplace extends Benchmarker { public function __construct() { parent::__construct(); $this->mDescription = "Benchmark for strtr() vs str_replace()."; @@ -70,8 +69,7 @@ function benchstr_replace_indirect() { bfNormalizeTitleStrReplace( "[[MediaWiki:Some_random_test_page]]" ); } - } -$maintClass = 'bench_strtr_str_replace'; +$maintClass = 'BenchStrtrStrReplace'; require_once RUN_MAINTENANCE_IF_MAIN; diff --git a/maintenance/benchmarks/bench_utf8_title_check.php b/maintenance/benchmarks/bench_utf8_title_check.php index 078293e..1c31256 100644 --- a/maintenance/benchmarks/bench_utf8_title_check.php +++ b/maintenance/benchmarks/bench_utf8_title_check.php @@ -29,8 +29,7 @@ * * @ingroup Benchmark */ -class bench_utf8_title_check extends Benchmarker { - +class BenchUtf8TitleCheck extends Benchmarker { private $canRun; private $data; @@ -38,6 +37,7 @@ public function __construct() { parent::__construct(); + // @codingStandardsIgnoreStart Ignore long line warnings. $this->data = array( "", "United States of America", // 7bit ASCII @@ -59,11 +59,13 @@ . "Sara%20Sidle%7CSofia%20Curtis%7CS%C3%A9rie%20t%C3%A9l%C3%A9vis%C3%A9e%7CWallace%20Langham%7C" . "Warrick%20Brown%7CWendy%20Simms%7C%C3%89tats-Unis" ); + // @codingStandardsIgnoreEnd $this->canRun = function_exists ( 'mb_check_encoding' ); if ( $this->canRun ) { - $this->mDescription = "Benchmark for using a regexp vs. mb_check_encoding to check for UTF-8 encoding."; + $this->mDescription = "Benchmark for using a regexp vs. mb_check_encoding " . + "to check for UTF-8 encoding."; mb_internal_encoding( 'UTF-8' ); } else { $this->mDescription = "CANNOT RUN benchmark using mb_check_encoding: function not available."; @@ -119,8 +121,7 @@ function use_mb_check_encoding( $s ) { $this->isutf8 = mb_check_encoding( $s, 'UTF-8' ); } - } -$maintClass = 'bench_utf8_title_check'; +$maintClass = 'BenchUtf8TitleCheck'; require_once RUN_MAINTENANCE_IF_MAIN; diff --git a/maintenance/benchmarks/bench_wfBaseConvert.php b/maintenance/benchmarks/bench_wfBaseConvert.php index f8a2156..d08a0b0 100644 --- a/maintenance/benchmarks/bench_wfBaseConvert.php +++ b/maintenance/benchmarks/bench_wfBaseConvert.php @@ -29,8 +29,7 @@ * * @ingroup Benchmark */ -class bench_wfBaseConvert extends Benchmarker { - +class BenchWfBaseConvert extends Benchmarker { public function __construct() { parent::__construct(); $this->mDescription = "Benchmark for wfBaseConvert."; @@ -73,5 +72,5 @@ } } -$maintClass = 'bench_wfBaseConvert'; +$maintClass = 'BenchWfBaseConvert'; require_once RUN_MAINTENANCE_IF_MAIN; diff --git a/maintenance/benchmarks/bench_wfIsWindows.php b/maintenance/benchmarks/bench_wfIsWindows.php index 76cea2c..b5cb025 100644 --- a/maintenance/benchmarks/bench_wfIsWindows.php +++ b/maintenance/benchmarks/bench_wfIsWindows.php @@ -31,8 +31,7 @@ * * @ingroup Benchmark */ -class bench_wfIsWindows extends Benchmarker { - +class BenchWfIsWindows extends Benchmarker { public function __construct() { parent::__construct(); $this->mDescription = "Benchmark for wfIsWindows."; @@ -65,5 +64,5 @@ } } -$maintClass = 'bench_wfIsWindows'; +$maintClass = 'BenchWfIsWindows'; require_once RUN_MAINTENANCE_IF_MAIN; diff --git a/maintenance/benchmarks/benchmarkHooks.php b/maintenance/benchmarks/benchmarkHooks.php index 59d3bdf..bb7af2b 100644 --- a/maintenance/benchmarks/benchmarkHooks.php +++ b/maintenance/benchmarks/benchmarkHooks.php @@ -29,7 +29,6 @@ * @ingroup Benchmark */ class BenchmarkHooks extends Benchmarker { - public function __construct() { parent::__construct(); $this->mDescription = 'Benchmark MediaWiki Hooks.'; diff --git a/maintenance/benchmarks/benchmarkPurge.php b/maintenance/benchmarks/benchmarkPurge.php index 1797358..dcaacab 100644 --- a/maintenance/benchmarks/benchmarkPurge.php +++ b/maintenance/benchmarks/benchmarkPurge.php @@ -29,7 +29,6 @@ * @ingroup Benchmark */ class BenchmarkPurge extends Benchmarker { - public function __construct() { parent::__construct(); $this->mDescription = "Benchmark the Squid purge functions."; -- To view, visit https://gerrit.wikimedia.org/r/129022 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I73558930909b35bbc13d0a0ac9368485cb2aa8c4 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Siebrand <siebr...@kitano.nl> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits