jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/402934 )
Change subject: Improve some parameter docs ...................................................................... Improve some parameter docs Change-Id: I2349c03faf9d59e9201913d610d1e790d1b5ec57 --- M .phpcs.xml M MediaWikiFarmer.php M MediaWikiFarmer_Extension.php M MediaWikiFarmer_Wiki.php M SpecialFarmer.php 5 files changed, 41 insertions(+), 21 deletions(-) Approvals: Umherirrender: Looks good to me, approved jenkins-bot: Verified diff --git a/.phpcs.xml b/.phpcs.xml index 4b0f68a..cdefebc 100644 --- a/.phpcs.xml +++ b/.phpcs.xml @@ -2,9 +2,6 @@ <ruleset> <rule ref="./vendor/mediawiki/mediawiki-codesniffer/MediaWiki"> <exclude name="MediaWiki.Commenting.FunctionComment.MissingParamComment" /> - <exclude name="MediaWiki.Commenting.FunctionComment.MissingParamName" /> - <exclude name="MediaWiki.Commenting.FunctionComment.MissingParamTag" /> - <exclude name="MediaWiki.Commenting.FunctionComment.MissingReturn" /> <exclude name="MediaWiki.Commenting.FunctionComment.WrongStyle" /> <exclude name="MediaWiki.Files.ClassMatchesFilename.NotMatch" /> <exclude name="MediaWiki.Usage.ForbiddenFunctions.extract" /> @@ -14,5 +11,4 @@ <file>.</file> <arg name="extensions" value="php,php5,inc" /> <arg name="encoding" value="UTF-8" /> - <exclude-pattern>vendor</exclude-pattern> </ruleset> diff --git a/MediaWikiFarmer.php b/MediaWikiFarmer.php index f5186c0..8b60e8f 100644 --- a/MediaWikiFarmer.php +++ b/MediaWikiFarmer.php @@ -71,9 +71,7 @@ } /** - * Constructor - * - * @param $params Array of parameters to control behavior + * @param array $params Array of parameters to control behavior * * @todo Load up special page */ @@ -141,6 +139,7 @@ /** * Get the active wiki for this MediaWikiFarmer instance + * @return MediaWikiFarmer_Wiki */ public function getActiveWiki() { return $this->_activeWiki; @@ -355,6 +354,8 @@ /** * Returns the database table prefix, as suitable for $wgDBprefix + * @param string $wiki + * @return array */ public function splitWikiDB( $wiki ) { $callback = $this->_dbFromWikiFunction; @@ -365,9 +366,9 @@ * Default callback function to get an database name and prefix for a wiki * in the farm * - * @param $farmer MediaWikiFarmer - * @param $wiki String - * @return Array + * @param MediaWikiFarmer $farmer + * @param string $wiki + * @return array */ // @codingStandardsIgnoreStart protected static function _prefixTable( MediaWikiFarmer $farmer, $wiki ) { @@ -385,8 +386,8 @@ /** * Get a database object * - * @param $type integer: either DB_SLAVE for DB_MASTER - * @return Database object + * @param int $type Either DB_REPLICA for DB_MASTER + * @return \Wikimedia\Rdbms\IDatabase */ public function getDB( $type ) { if ( !$this->useDatabase() ) { @@ -410,8 +411,8 @@ /** * Determines whether the user can create a wiki * - * @param $user User object - * @param $wiki String: wiki name (optional) + * @param User $user User object + * @param string $wiki wiki name (optional) * * @return bool */ @@ -422,8 +423,8 @@ /** * Determines whether manage the wiki farm * - * @param $user User object - * @return Boolean + * @param User $user User object + * @return bool */ public static function userIsFarmerAdmin( $user ) { return $user->isAllowed( 'farmeradmin' ); @@ -446,7 +447,8 @@ /** * Gets extensions objects * - * @return Array + * @param bool $forceReload + * @return array */ public function getExtensions( $forceReload = false ) { if ( $this->_extensionsLoaded && !$forceReload ) { @@ -480,6 +482,7 @@ /** * Register an extension so that it's available for all wikis in the farm + * @param MediaWikiFarmer_Extension $e */ public function registerExtension( MediaWikiFarmer_Extension $e ) { if ( $this->useDatabase() ) { diff --git a/MediaWikiFarmer_Extension.php b/MediaWikiFarmer_Extension.php index 2d30c17..874467a 100644 --- a/MediaWikiFarmer_Extension.php +++ b/MediaWikiFarmer_Extension.php @@ -33,6 +33,8 @@ /** * Magic method so we can access variables directly without accessor * functions + * @param string $key + * @return mixed */ public function __get( $key ) { $property = '_' . $key; @@ -43,6 +45,7 @@ /** * Sees if extension is valid by looking at included files and attempting to * open them + * @return bool */ public function isValid() { foreach ( $this->_includeFiles as $file ) { diff --git a/MediaWikiFarmer_Wiki.php b/MediaWikiFarmer_Wiki.php index 67cd3ec..066df53 100644 --- a/MediaWikiFarmer_Wiki.php +++ b/MediaWikiFarmer_Wiki.php @@ -34,6 +34,8 @@ /** * Creates a wiki instance from a wiki name + * @param string $wiki + * @param array $variables */ public function __construct( $wiki, $variables = [] ) { $this->_name = $wiki; @@ -61,6 +63,7 @@ /** * How to represent this object as a string + * @return string */ public function __toString() { return $this->_name; @@ -96,6 +99,12 @@ /** * Create a new wiki from settings + * @param string $name + * @param string $title + * @param string $description + * @param string $creator + * @param array $variables + * @return MediaWikiFarmer */ public static function newFromParams( $name, $title, $description, $creator, $variables = [] @@ -157,6 +166,7 @@ * * Simply looks for file presence. We don't have to clear the stat cache * because if a file doesn't exist, this isn't stored in the stat cache + * @return bool */ public function exists() { $farmer = MediaWikiFarmer::getInstance(); @@ -424,7 +434,8 @@ /** * Obtain a database connection suitable for interfacing with wiki $name * - * @param $selectDB whether to select the database + * @param bool $selectDB whether to select the database + * @return \Wikimedia\Rdbms\IDatabase */ public function getDatabase( $selectDB = true ) { global $wgDBserver, $wgDBtype; diff --git a/SpecialFarmer.php b/SpecialFarmer.php index 794c2f8..1f10ecc 100644 --- a/SpecialFarmer.php +++ b/SpecialFarmer.php @@ -12,15 +12,13 @@ * @todo Move presentation text into MW messages */ class SpecialFarmer extends SpecialPage { - /** - * Class constructor - */ public function __construct() { parent::__construct( 'Farmer' ); } /** * Executes special page + * @param string|null $par */ public function execute( $par ) { global $wgRequest; @@ -56,6 +54,7 @@ /** * Displays the main page + * @param MediaWikiFarmer $wgFarmer */ // @codingStandardsIgnoreStart protected function _executeMainPage( $wgFarmer ) { @@ -110,6 +109,8 @@ /** * Displays form to create wiki + * @param MediaWikiFarmer $wgFarmer + * @param string $wiki */ // @codingStandardsIgnoreStart protected function _executeCreate( $wgFarmer, $wiki ) { @@ -561,6 +562,7 @@ /** * Handles page to manage extensions + * @param MediaWikiFarmer $wgFarmer */ // @codingStandardsIgnoreStart protected function _executeManageExtensions( $wgFarmer ) { @@ -646,6 +648,11 @@ /** * Creates form element representing an individual permission + * @param OutputPage $wgOut + * @param string &$wiki + * @param string $group + * @param string $permission + * @param string $description */ // @codingStandardsIgnoreStart protected function _doPermissionInput( $wgOut, &$wiki, $group, $permission, $description ) { -- To view, visit https://gerrit.wikimedia.org/r/402934 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2349c03faf9d59e9201913d610d1e790d1b5ec57 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Farmer Gerrit-Branch: master Gerrit-Owner: Umherirrender <umherirrender_de...@web.de> Gerrit-Reviewer: Umherirrender <umherirrender_de...@web.de> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits