From fb768db1880ea11e0e43a93aacbf57134ea7726d Mon Sep 17 00:00:00 2001 From: umherirrender Date: Tue, 13 May 2014 20:37:41 +0200 Subject: [PATCH] Expand doc of ApiBase::require*Parameter functions Add a hint to the getError function which should be called in the getPossibleErrors() function. Also do this for getTitleOrPageId. Change-Id: I601feb8a5b8699ce4d81814aa3cd127552a525ac --- includes/api/ApiBase.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/includes/api/ApiBase.php b/includes/api/ApiBase.php index a1e02efe92..cfd4d01db1 100644 --- a/includes/api/ApiBase.php +++ b/includes/api/ApiBase.php @@ -720,6 +720,9 @@ abstract class ApiBase extends ContextSource { /** * Die if none or more than one of a certain set of parameters is set and not false. + * + * Call getRequireOnlyOneParameterErrorMessages() to get a list of possible errors. + * * @param array $params User provided set of parameters, as from $this->extractRequestParams() * @param string $required,... Names of parameters of which exactly one must be set */ @@ -767,6 +770,9 @@ abstract class ApiBase extends ContextSource { /** * Die if more than one of a certain set of parameters is set and not false. + * + * Call getRequireMaxOneParameterErrorMessages() to get a list of possible errors. + * * @param array $params User provided set of parameters, as from $this->extractRequestParams() * @param string $required,... Names of parameters of which at most one must be set */ @@ -807,6 +813,8 @@ abstract class ApiBase extends ContextSource { /** * Die if none of a certain set of parameters is set and not false. * + * Call getRequireAtLeastOneParameterErrorMessages() to get a list of possible errors. + * * @since 1.23 * @param array $params User provided set of parameters, as from $this->extractRequestParams() * @param string $required,... Names of parameters of which at least one must be set @@ -847,6 +855,11 @@ abstract class ApiBase extends ContextSource { } /** + * Get a WikiPage object from a title or pageid param, if possible. + * Can die, if no param is set or if the title or page id is not valid. + * + * Call getTitleOrPageIdErrorMessage() to get a list of possible errors. + * * @param array $params * @param bool|string $load Whether load the object's state from the database: * - false: don't load (if the pageid is given, it will still be loaded) @@ -884,6 +897,8 @@ abstract class ApiBase extends ContextSource { } /** + * Generates the possible error getTitleOrPageId() can die with + * * @return array */ public function getTitleOrPageIdErrorMessage() { -- 2.20.1