Seb35 has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/372757 )
Change subject: Update coding rules according to phpcs ...................................................................... Update coding rules according to phpcs Change-Id: I42a24b5000f50558f219622b08c5e49de754ca58 --- M src/AbstractMediaWikiFarmScript.php M src/MediaWikiFarm.php M src/MediaWikiFarmConfiguration.php M tests/perfs/MediaWikiFarmTestPerfs.php M tests/perfs/perfs.php M tests/phpunit/MultiversionInstallationTest.php 6 files changed, 13 insertions(+), 12 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MediaWikiFarm refs/changes/57/372757/1 diff --git a/src/AbstractMediaWikiFarmScript.php b/src/AbstractMediaWikiFarmScript.php index caa0659..99f6283 100644 --- a/src/AbstractMediaWikiFarmScript.php +++ b/src/AbstractMediaWikiFarmScript.php @@ -90,7 +90,7 @@ break; } elseif( $this->argv[$posArg] == '--'.$name && $posArg < $this->argc - 1 ) { - $value = $this->argv[$posArg+1]; + $value = $this->argv[$posArg + 1]; $nbArgs = 2; break; } @@ -111,7 +111,7 @@ if( $shift ) { $this->argc -= $nbArgs; - $this->argv = array_merge( array_slice( $this->argv, 0, $posArg ), array_slice( $this->argv, $posArg+$nbArgs ) ); + $this->argv = array_merge( array_slice( $this->argv, 0, $posArg ), array_slice( $this->argv, $posArg + $nbArgs ) ); } return $value; diff --git a/src/MediaWikiFarm.php b/src/MediaWikiFarm.php index 7603cc9..147e1b7 100644 --- a/src/MediaWikiFarm.php +++ b/src/MediaWikiFarm.php @@ -806,7 +806,7 @@ * * @param string $host Requested host. * @param array $farms All farm configurations. - * @param integer $redirects Number of remaining internal redirects before error. + * @param int $redirects Number of remaining internal redirects before error. * @return array */ function selectFarm( $host, $farms, $redirects ) { diff --git a/src/MediaWikiFarmConfiguration.php b/src/MediaWikiFarmConfiguration.php index 97cea26..5033c07 100644 --- a/src/MediaWikiFarmConfiguration.php +++ b/src/MediaWikiFarmConfiguration.php @@ -253,7 +253,7 @@ $settingsArray[$setting] = array(); $prioritiesArray[$setting] = 0; } - $thisSetting = &$settingsArray[$setting]; + $thisSetting = &$settingsArray[$setting]; $thisPriority = &$prioritiesArray[$setting]; } else { $settingIsArray = false; @@ -261,7 +261,7 @@ $settings[$setting] = null; $priorities[$setting] = 0; } - $thisSetting = &$settings[$setting]; + $thisSetting = &$settings[$setting]; $thisPriority = &$priorities[$setting]; if( substr( $setting, 0, 14 ) == 'wgUseExtension' ) { $extensions['Extension' . substr( $rawSetting, 14 )] = array( substr( $rawSetting, 14 ), 'extension', null, count( $extensions ) ); @@ -489,7 +489,7 @@ * * @param string $type Type, in ['extension', 'skin']. * @param string $name Name of the extension/skin. - * @return boolean The extension/skin is Composer-managed (at least for its installation). + * @return bool The extension/skin is Composer-managed (at least for its installation). */ function detectComposer( $type, $name ) { @@ -609,7 +609,7 @@ * @internal * * @param array $configuration Array with the schema defined for $this->configuration. - * @param boolean $isMonoversion Is MediaWikiFarm configured for monoversion? + * @param bool $isMonoversion Is MediaWikiFarm configured for monoversion? * @param string $preconfig PHP code to be added at the top of the file. * @param string $postconfig PHP code to be added at the end of the file. * @return string Content of the file LocalSettings.php. diff --git a/tests/perfs/MediaWikiFarmTestPerfs.php b/tests/perfs/MediaWikiFarmTestPerfs.php index 7bf4e4c..c094458 100644 --- a/tests/perfs/MediaWikiFarmTestPerfs.php +++ b/tests/perfs/MediaWikiFarmTestPerfs.php @@ -155,7 +155,7 @@ * This function is very similar to its parent but adds counters in the file. * * @param array $configuration Array with the schema defined for $this->configuration. - * @param boolean $isMonoversion Is MediaWikiFarm configured for monoversion? + * @param bool $isMonoversion Is MediaWikiFarm configured for monoversion? * @param string $preconfig PHP code to be added at the top of the file. * @param string $postconfig PHP code to be added at the end of the file. * @return string Content of the file LocalSettings.php. @@ -179,10 +179,10 @@ */ function getMediaWikiConfig( $force = false ) { - MediaWikiFarmTestPerfs::startCounter( 'compilation' ); + self::startCounter( 'compilation' ); parent::getMediaWikiConfig( $force ); - MediaWikiFarmTestPerfs::stopCounter( 'compilation' ); + self::stopCounter( 'compilation' ); } } diff --git a/tests/perfs/perfs.php b/tests/perfs/perfs.php index a5dc15a..31554f7 100644 --- a/tests/perfs/perfs.php +++ b/tests/perfs/perfs.php @@ -38,11 +38,11 @@ } # Run -for( $i=0; $i<$sampleSize; $i++ ) { +for( $i = 0; $i < $sampleSize; $i++ ) { if( $i > 0 && $i % 100 == 0 ) { echo "\n"; } - for( $j=0; $j<$profiles; $j++ ) { + for( $j = 0; $j < $profiles; $j++ ) { file_get_contents( $host ); usleep( rand( 3, 20 ) ); } diff --git a/tests/phpunit/MultiversionInstallationTest.php b/tests/phpunit/MultiversionInstallationTest.php index 15b78cb..a22a939 100644 --- a/tests/phpunit/MultiversionInstallationTest.php +++ b/tests/phpunit/MultiversionInstallationTest.php @@ -462,6 +462,7 @@ * Test cache of checkExistence(). * * @medium + * @uses MediaWikiFarmConfiguration * @uses AbstractMediaWikiFarmScript::rmdirr */ function testCacheExistence() { -- To view, visit https://gerrit.wikimedia.org/r/372757 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I42a24b5000f50558f219622b08c5e49de754ca58 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MediaWikiFarm Gerrit-Branch: master Gerrit-Owner: Seb35 <se...@seb35.fr> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits