From 7761a9e60b1d1ff3e089deee836fa433ea37a9a2 Mon Sep 17 00:00:00 2001 From: Umherirrender Date: Sat, 7 Oct 2017 16:54:28 +0200 Subject: [PATCH] Improve some parameter docs Change-Id: Icd8fd55cf1a4a83a6f674038e098b9be8257dc0c --- UniversalLanguageSelector.hooks.php | 18 +++++++++++++----- api/ApiLanguageSearch.php | 2 +- api/ApiULSLocalization.php | 4 ++-- data/LanguageNameSearch.php | 6 +++--- includes/ResourceLoaderULSModule.php | 2 +- phpcs.xml | 5 ----- 6 files changed, 20 insertions(+), 17 deletions(-) diff --git a/UniversalLanguageSelector.hooks.php b/UniversalLanguageSelector.hooks.php index bd9b9369..70135b41 100644 --- a/UniversalLanguageSelector.hooks.php +++ b/UniversalLanguageSelector.hooks.php @@ -19,7 +19,10 @@ */ class UniversalLanguageSelectorHooks { - // Used when extension registration in use which skips the main php file + + /** + * Used when extension registration in use which skips the main php file + */ public static function setVersionConstant() { define( 'ULS_VERSION', '2017-07-25' ); } @@ -88,6 +91,8 @@ class UniversalLanguageSelectorHooks { * user account is new. * * To be removed once no longer needed. + * @param User $user + * @param bool $autoCreate */ public static function onLocalUserCreated( User $user, $autoCreate ) { if ( RequestContext::getMain()->getConfig()->get( 'ULSCompactLinksForNewAccounts' ) ) { @@ -141,7 +146,7 @@ class UniversalLanguageSelectorHooks { } /** - * @param $testModules array of javascript testing modules. 'qunit' is fed + * @param array &$testModules array of javascript testing modules. 'qunit' is fed * using tests/qunit/QUnitTestResources.php. * @param ResourceLoader $resourceLoader * @return bool @@ -161,6 +166,9 @@ class UniversalLanguageSelectorHooks { /** * Add some tabs for navigation for users who do not use Ajax interface. * Hook: PersonalUrls + * @param array &$personal_urls + * @param string &$title + * @return true */ public static function addPersonalBarTrigger( array &$personal_urls, &$title ) { global $wgULSPosition; @@ -219,7 +227,7 @@ class UniversalLanguageSelectorHooks { /** * Hook to UserGetLanguageObject * @param User $user - * @param string $code + * @param string &$code * @param IContextSource $context * @return bool */ @@ -292,7 +300,7 @@ class UniversalLanguageSelectorHooks { /** * Hook: ResourceLoaderGetConfigVars - * @param array $vars + * @param array &$vars * @return bool */ public static function addConfig( &$vars ) { @@ -341,7 +349,7 @@ class UniversalLanguageSelectorHooks { /** * Hook: MakeGlobalVariablesScript - * @param array $vars + * @param array &$vars * @param OutputPage $out * @return bool */ diff --git a/api/ApiLanguageSearch.php b/api/ApiLanguageSearch.php index bf1bb3b5..1007fd4c 100644 --- a/api/ApiLanguageSearch.php +++ b/api/ApiLanguageSearch.php @@ -46,7 +46,7 @@ class ApiLanguageSearch extends ApiBase { } /** - * @see ApiBase::getExamplesMessages() + * @inheritDoc */ protected function getExamplesMessages() { return [ diff --git a/api/ApiULSLocalization.php b/api/ApiULSLocalization.php index 2b618250..c86b5db9 100644 --- a/api/ApiULSLocalization.php +++ b/api/ApiULSLocalization.php @@ -59,7 +59,7 @@ class ApiULSLocalization extends ApiBase { } /** - * @see ApiBase::getExamplesMessages() + * @inheritDoc */ protected function getExamplesMessages() { return [ @@ -70,8 +70,8 @@ class ApiULSLocalization extends ApiBase { ]; } - // Try to scare people away from using this externally public function isInternal() { + // Try to scare people away from using this externally return true; } } diff --git a/data/LanguageNameSearch.php b/data/LanguageNameSearch.php index de62134d..1645e50d 100644 --- a/data/LanguageNameSearch.php +++ b/data/LanguageNameSearch.php @@ -60,7 +60,7 @@ class LanguageNameSearch { /** * Get the code point of first letter of string * - * @param $str string + * @param string $str * @return int Code point of first letter of string */ public static function getCodepoint( $str ) { @@ -104,8 +104,8 @@ class LanguageNameSearch { /** * Calculate the Levenshtein distance between two strings - * @param $str1 - * @param $str2 + * @param string $str1 + * @param string $str2 * @return int */ public static function levenshteinDistance( $str1, $str2 ) { diff --git a/includes/ResourceLoaderULSModule.php b/includes/ResourceLoaderULSModule.php index 17330d66..e39d547d 100644 --- a/includes/ResourceLoaderULSModule.php +++ b/includes/ResourceLoaderULSModule.php @@ -41,7 +41,7 @@ class ResourceLoaderULSModule extends ResourceLoaderModule { } /** - * @param $context ResourceLoaderContext + * @param ResourceLoaderContext $context * @return string JavaScript code */ public function getScript( ResourceLoaderContext $context ) { diff --git a/phpcs.xml b/phpcs.xml index eee0983d..f189ea1e 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -2,11 +2,6 @@ - - - - -