api: Add missing documentation to class properties
Add doc-typehints to class properties found by the PropertyDocumentation sniff to improve the documentation. Once the sniff is enabled it avoids that new code is missing type declarations. This is focused on documentation and does not change code. Change-Id: I8b33b5f4d91c1935228e7010327dbc6ce138fc00
This commit is contained in:
parent
e659256efe
commit
3fca49a1f4
33 changed files with 80 additions and 1 deletions
|
|
@ -288,6 +288,7 @@ abstract class ApiBase extends ContextSource {
|
|||
/** @var string */
|
||||
private $mModulePrefix;
|
||||
|
||||
/** @var IReadableDatabase|null */
|
||||
private $mReplicaDB = null;
|
||||
/**
|
||||
* @var array
|
||||
|
|
|
|||
|
|
@ -46,6 +46,7 @@ class ApiComparePages extends ApiBase {
|
|||
|
||||
/** @var Title|null|false */
|
||||
private $guessedTitle = false;
|
||||
/** @var array<string,true> */
|
||||
private $props;
|
||||
|
||||
private IContentHandlerFactory $contentHandlerFactory;
|
||||
|
|
|
|||
|
|
@ -46,7 +46,9 @@ class ApiErrorFormatter {
|
|||
protected $lang;
|
||||
/** @var PageReference|null page used for rendering error messages, or null to use the dummy title */
|
||||
private $title = null;
|
||||
/** @var bool */
|
||||
protected $useDB = false;
|
||||
/** @var string */
|
||||
protected $format = 'none';
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ use Wikimedia\ParamValidator\TypeDef\IntegerDef;
|
|||
*/
|
||||
class ApiFeedRecentChanges extends ApiBase {
|
||||
|
||||
/** @var array */
|
||||
private $params;
|
||||
|
||||
private SpecialPageFactory $specialPageFactory;
|
||||
|
|
|
|||
|
|
@ -37,7 +37,9 @@ use Wikimedia\ParamValidator\TypeDef\IntegerDef;
|
|||
*/
|
||||
class ApiFeedWatchlist extends ApiBase {
|
||||
|
||||
/** @var ApiBase|null */
|
||||
private $watchlistModule = null;
|
||||
/** @var bool */
|
||||
private $linkToSections = false;
|
||||
|
||||
private ParserFactory $parserFactory;
|
||||
|
|
|
|||
|
|
@ -39,8 +39,11 @@ abstract class ApiFormatBase extends ApiBase {
|
|||
private string $mFormat;
|
||||
private string $mBuffer = '';
|
||||
private bool $mDisabled = false;
|
||||
/** @var bool */
|
||||
private $mIsWrappedHtml = false;
|
||||
/** @var int|false */
|
||||
private $mHttpStatus = false;
|
||||
/** @var bool */
|
||||
protected $mForceDefaultParams = false;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ use Wikimedia\ParamValidator\ParamValidator;
|
|||
*/
|
||||
class ApiFormatJson extends ApiFormatBase {
|
||||
|
||||
/** @var bool */
|
||||
private $isRaw;
|
||||
|
||||
public function __construct( ApiMain $main, $format ) {
|
||||
|
|
|
|||
|
|
@ -26,7 +26,9 @@
|
|||
*/
|
||||
class ApiFormatRaw extends ApiFormatBase {
|
||||
|
||||
/** @var ApiFormatBase|null */
|
||||
private $errorFallback;
|
||||
/** @var bool */
|
||||
private $mFailWithHTTPError = false;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -30,9 +30,13 @@ use Wikimedia\ParamValidator\ParamValidator;
|
|||
*/
|
||||
class ApiFormatXml extends ApiFormatBase {
|
||||
|
||||
/** @var string */
|
||||
private $mRootElemName = 'api';
|
||||
/** @var string */
|
||||
public static $namespace = 'http://www.mediawiki.org/xml/api/';
|
||||
/** @var bool */
|
||||
private $mIncludeNamespace = false;
|
||||
/** @var string|null */
|
||||
private $mXslt = null;
|
||||
|
||||
public function getMimeType() {
|
||||
|
|
|
|||
|
|
@ -35,8 +35,11 @@ use MediaWiki\Message\Message;
|
|||
*/
|
||||
class ApiHelpParamValueMessage extends Message {
|
||||
|
||||
/** @var string */
|
||||
protected $paramValue;
|
||||
/** @var bool */
|
||||
protected $deprecated;
|
||||
/** @var bool */
|
||||
protected $internal;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ use Wikimedia\ParamValidator\ParamValidator;
|
|||
* @ingroup API
|
||||
*/
|
||||
class ApiImageRotate extends ApiBase {
|
||||
/** @var ApiPageSet|null */
|
||||
private $mPageSet = null;
|
||||
|
||||
private RepoGroup $repoGroup;
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ use MediaWiki\Title\ForeignTitle;
|
|||
* @ingroup API
|
||||
*/
|
||||
class ApiImportReporter extends ImportReporter {
|
||||
/** @var array[] */
|
||||
private $mResultArr = [];
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -2417,6 +2417,7 @@ class ApiMain extends ApiBase {
|
|||
}
|
||||
}
|
||||
|
||||
/** @var bool|null */
|
||||
private $mCanApiHighLimits = null;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ trait ApiMessageTrait {
|
|||
/**
|
||||
* Compatibility code mappings for various MW messages.
|
||||
* @todo Ideally anything relying on this should be changed to use ApiMessage.
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $messageMap = [
|
||||
'actionthrottledtext' => 'ratelimited',
|
||||
|
|
@ -93,7 +94,9 @@ trait ApiMessageTrait {
|
|||
'userrights-no-interwiki' => 'nointerwikiuserrights',
|
||||
];
|
||||
|
||||
/** @var string|null */
|
||||
protected $apiCode = null;
|
||||
/** @var array */
|
||||
protected $apiData = [];
|
||||
|
||||
public function getApiCode() {
|
||||
|
|
|
|||
|
|
@ -35,7 +35,9 @@ use Wikimedia\ParamValidator\ParamValidator;
|
|||
class ApiOpenSearch extends ApiBase {
|
||||
use SearchApi;
|
||||
|
||||
/** @var string|null */
|
||||
private $format = null;
|
||||
/** @var string|null */
|
||||
private $fm = null;
|
||||
|
||||
private LinkBatchFactory $linkBatchFactory;
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@
|
|||
* @ingroup API
|
||||
*/
|
||||
class ApiOpenSearchFormatJson extends ApiFormatJson {
|
||||
/** @var bool */
|
||||
private $warningsAsError;
|
||||
|
||||
public function __construct( ApiMain $main, $fm, $warningsAsError ) {
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@ use Wikimedia\ParamValidator\ParamValidator;
|
|||
*/
|
||||
class ApiParamInfo extends ApiBase {
|
||||
|
||||
/** @var string */
|
||||
private $helpFormat;
|
||||
|
||||
/** @var RequestContext */
|
||||
|
|
|
|||
|
|
@ -567,7 +567,9 @@ class ApiQuery extends ApiBase {
|
|||
*/
|
||||
private $mPageSet;
|
||||
|
||||
/** @var array */
|
||||
private $mParams;
|
||||
/** @var ApiModuleManager */
|
||||
private $mModuleMgr;
|
||||
|
||||
private WikiExporterFactory $wikiExporterFactory;
|
||||
|
|
|
|||
|
|
@ -40,10 +40,15 @@ class ApiQueryAllLinks extends ApiQueryGeneratorBase {
|
|||
private string $table;
|
||||
private string $tablePrefix;
|
||||
private string $indexTag;
|
||||
/** @var string */
|
||||
private $fieldTitle = 'title';
|
||||
/** @var int */
|
||||
private $dfltNamespace = NS_MAIN;
|
||||
/** @var bool */
|
||||
private $hasNamespace = true;
|
||||
/** @var string|null */
|
||||
private $useIndex = null;
|
||||
/** @var array */
|
||||
private $props = [];
|
||||
|
||||
private NamespaceInfo $namespaceInfo;
|
||||
|
|
|
|||
|
|
@ -45,9 +45,11 @@ class ApiQueryBacklinks extends ApiQueryGeneratorBase {
|
|||
*/
|
||||
private $linksMigration;
|
||||
|
||||
/** @var array */
|
||||
private $params;
|
||||
/** @var array */
|
||||
private $cont;
|
||||
/** @var bool */
|
||||
private $redirect;
|
||||
|
||||
private string $bl_ns;
|
||||
|
|
@ -67,9 +69,12 @@ class ApiQueryBacklinks extends ApiQueryGeneratorBase {
|
|||
* @var array
|
||||
*/
|
||||
private $pageMap = [];
|
||||
/** @var array */
|
||||
private $resultArr;
|
||||
|
||||
/** @var array */
|
||||
private $redirTitles = [];
|
||||
/** @var string|null */
|
||||
private $continueStr = null;
|
||||
|
||||
/** @var string[][] output element name, database column field prefix, database table */
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@
|
|||
*/
|
||||
abstract class ApiQueryGeneratorBase extends ApiQueryBase {
|
||||
|
||||
/** @var ApiPageSet|null */
|
||||
private $mGeneratorPageSet = null;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@ use Wikimedia\ParamValidator\TypeDef\IntegerDef;
|
|||
*/
|
||||
class ApiQueryImageInfo extends ApiQueryBase {
|
||||
public const TRANSFORM_LIMIT = 50;
|
||||
/** @var int */
|
||||
private static $transformCount = 0;
|
||||
|
||||
private RepoGroup $repoGroup;
|
||||
|
|
|
|||
|
|
@ -95,6 +95,7 @@ class ApiQueryInfo extends ApiQueryBase {
|
|||
*/
|
||||
private $fld_associatedpage = false;
|
||||
|
||||
/** @var array */
|
||||
private $params;
|
||||
|
||||
/** @var array<int,PageIdentity> */
|
||||
|
|
@ -130,15 +131,25 @@ class ApiQueryInfo extends ApiQueryBase {
|
|||
*/
|
||||
private $pageLength;
|
||||
|
||||
/** @var array[][][] */
|
||||
private $protections;
|
||||
/** @var string[][][] */
|
||||
private $restrictionTypes;
|
||||
/** @var bool[][] */
|
||||
private $watched;
|
||||
/** @var int[][] */
|
||||
private $watchers;
|
||||
/** @var int[][] */
|
||||
private $visitingwatchers;
|
||||
/** @var string[][] */
|
||||
private $notificationtimestamps;
|
||||
/** @var int[][] */
|
||||
private $talkids;
|
||||
/** @var int[][] */
|
||||
private $subjectids;
|
||||
/** @var string[][] */
|
||||
private $displaytitles;
|
||||
/** @var string[][] */
|
||||
private $variantTitles;
|
||||
|
||||
/**
|
||||
|
|
@ -153,8 +164,10 @@ class ApiQueryInfo extends ApiQueryBase {
|
|||
*/
|
||||
private $linkClasses;
|
||||
|
||||
/** @var bool */
|
||||
private $showZeroWatchers = false;
|
||||
|
||||
/** @var int */
|
||||
private $countTestedActions = 0;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -55,6 +55,7 @@ class ApiQueryRecentChanges extends ApiQueryGeneratorBase {
|
|||
private TempUserConfig $tempUserConfig;
|
||||
private LogFormatterFactory $logFormatterFactory;
|
||||
|
||||
/** @var string[] */
|
||||
private $formattedComments = [];
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -64,20 +64,31 @@ abstract class ApiQueryRevisionsBase extends ApiQueryGeneratorBase {
|
|||
|
||||
// endregion
|
||||
|
||||
// phpcs:ignore MediaWiki.Commenting.PropertyDocumentation.WrongStyle
|
||||
/** @var int|string|null */
|
||||
protected $limit;
|
||||
/** @var int|string|null */
|
||||
protected $diffto;
|
||||
/** @var string|null */
|
||||
protected $difftotext;
|
||||
/** @var bool */
|
||||
protected $difftotextpst;
|
||||
/** @var int|string|null */
|
||||
protected $expandTemplates;
|
||||
/** @var bool */
|
||||
protected $generateXML;
|
||||
/** @var int|string|null */
|
||||
protected $section;
|
||||
/** @var bool */
|
||||
protected $parseContent;
|
||||
/** @var bool */
|
||||
protected $fetchContent;
|
||||
/** @var string */
|
||||
protected $contentFormat;
|
||||
protected bool $setParsedLimit = true;
|
||||
protected ?array $slotRoles = null;
|
||||
/** @var string[] */
|
||||
protected $slotContentFormats;
|
||||
/** @var bool */
|
||||
protected $needSlots;
|
||||
|
||||
protected bool $fld_ids = false;
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@ use Wikimedia\ParamValidator\ParamValidator;
|
|||
class ApiQueryUsers extends ApiQueryBase {
|
||||
use ApiQueryBlockInfoTrait;
|
||||
|
||||
/** @var array<string,true> */
|
||||
private $prop;
|
||||
|
||||
private UserNameUtils $userNameUtils;
|
||||
|
|
|
|||
|
|
@ -31,7 +31,9 @@ use MediaWiki\MainConfigNames;
|
|||
*/
|
||||
class ApiRemoveAuthenticationData extends ApiBase {
|
||||
|
||||
/** @var string */
|
||||
private $authAction;
|
||||
/** @var string */
|
||||
private $operation;
|
||||
|
||||
private AuthManager $authManager;
|
||||
|
|
|
|||
|
|
@ -143,6 +143,7 @@ class ApiResult implements ApiSerializable {
|
|||
*/
|
||||
public const META_BC_SUBELEMENTS = '_BC_subelements';
|
||||
|
||||
/** @var mixed */
|
||||
private $data;
|
||||
private int $size;
|
||||
/** @var int|false */
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ use Wikimedia\Rdbms\IConnectionProvider;
|
|||
*/
|
||||
class ApiSetNotificationTimestamp extends ApiBase {
|
||||
|
||||
/** @var ApiPageSet|null */
|
||||
private $mPageSet = null;
|
||||
|
||||
private RevisionStore $revisionStore;
|
||||
|
|
|
|||
|
|
@ -49,6 +49,7 @@ class ApiUpload extends ApiBase {
|
|||
/** @var UploadBase|UploadFromChunks */
|
||||
protected $mUpload = null;
|
||||
|
||||
/** @var array */
|
||||
protected $mParams;
|
||||
|
||||
private JobQueueGroup $jobQueueGroup;
|
||||
|
|
|
|||
|
|
@ -31,7 +31,9 @@ use Wikimedia\Message\MessageSpecifier;
|
|||
*/
|
||||
class ApiUsageException extends MWException implements Stringable, ILocalizedException {
|
||||
|
||||
/** @var string|null */
|
||||
protected $modulePath;
|
||||
/** @var StatusValue */
|
||||
protected $status;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ use Wikimedia\ParamValidator\TypeDef\ExpiryDef;
|
|||
* @ingroup API
|
||||
*/
|
||||
class ApiWatch extends ApiBase {
|
||||
/** @var ApiPageSet|null */
|
||||
private $mPageSet = null;
|
||||
|
||||
/** @var bool Whether watchlist expiries are enabled. */
|
||||
|
|
|
|||
|
|
@ -51,6 +51,7 @@ trait SearchApi {
|
|||
* a valid option for an array for PARAM_TYPE, so we'll use a fake name
|
||||
* that can't possibly be a class name and describes what the null behavior
|
||||
* does
|
||||
* @var string
|
||||
*/
|
||||
private static $BACKEND_NULL_PARAM = 'database-backed';
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue