Merge "maintenance: Add missing documentation to class properties"
This commit is contained in:
commit
ced29cfbe0
37 changed files with 91 additions and 3 deletions
|
|
@ -33,6 +33,7 @@ require_once __DIR__ . '/Maintenance.php';
|
|||
* @ingroup Maintenance
|
||||
*/
|
||||
class TableCleanup extends Maintenance {
|
||||
/** @var array */
|
||||
protected $defaultParams = [
|
||||
'table' => 'page',
|
||||
'conds' => [],
|
||||
|
|
@ -40,7 +41,9 @@ class TableCleanup extends Maintenance {
|
|||
'callback' => 'processRow',
|
||||
];
|
||||
|
||||
/** @var bool */
|
||||
protected $dryrun = false;
|
||||
/** @var int */
|
||||
protected $reportInterval = 100;
|
||||
|
||||
protected int $processed;
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ require_once __DIR__ . '/../includes/Benchmarker.php';
|
|||
* @ingroup Benchmark
|
||||
*/
|
||||
class BenchmarkHooks extends Benchmarker {
|
||||
/** @inheritDoc */
|
||||
protected $defaultCount = 10;
|
||||
|
||||
public function __construct() {
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ require_once __DIR__ . '/../includes/Benchmarker.php';
|
|||
* @ingroup Benchmark
|
||||
*/
|
||||
class BenchmarkJsValidate extends Benchmarker {
|
||||
/** @inheritDoc */
|
||||
protected $defaultCount = 10;
|
||||
|
||||
public function __construct() {
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ require_once __DIR__ . '/../includes/Benchmarker.php';
|
|||
* @ingroup Benchmark
|
||||
*/
|
||||
class BenchmarkJsonCodec extends Benchmarker {
|
||||
/** @inheritDoc */
|
||||
protected $defaultCount = 100;
|
||||
|
||||
public function __construct() {
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ require_once __DIR__ . '/../includes/Benchmarker.php';
|
|||
* @ingroup Benchmark
|
||||
*/
|
||||
class BenchmarkLruHash extends Benchmarker {
|
||||
/** @inheritDoc */
|
||||
protected $defaultCount = 1000;
|
||||
|
||||
public function __construct() {
|
||||
|
|
|
|||
|
|
@ -43,6 +43,7 @@ class BenchmarkParse extends Maintenance {
|
|||
/** @var string MediaWiki concatenated string timestamp (YYYYMMDDHHMMSS) */
|
||||
private $templateTimestamp = null;
|
||||
|
||||
/** @var bool */
|
||||
private $clearLinkCache = false;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -70,7 +70,9 @@ SPARQLD;
|
|||
*/
|
||||
private $categoriesRdf;
|
||||
|
||||
/** @var string */
|
||||
private $startTS;
|
||||
/** @var string */
|
||||
private $endTS;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ require_once __DIR__ . '/Maintenance.php';
|
|||
*/
|
||||
class CheckDependencies extends Maintenance {
|
||||
|
||||
/** @var bool */
|
||||
private $checkDev;
|
||||
|
||||
public function __construct() {
|
||||
|
|
|
|||
|
|
@ -44,7 +44,9 @@ require_once __DIR__ . '/TableCleanup.php';
|
|||
*/
|
||||
class CleanupCaps extends TableCleanup {
|
||||
|
||||
/** @var User */
|
||||
private $user;
|
||||
/** @var int */
|
||||
private $namespace;
|
||||
|
||||
public function __construct() {
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ require_once __DIR__ . '/TableCleanup.php';
|
|||
* @ingroup Maintenance
|
||||
*/
|
||||
class CleanupImages extends TableCleanup {
|
||||
/** @inheritDoc */
|
||||
protected $defaultParams = [
|
||||
'table' => 'image',
|
||||
'conds' => [],
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@ require_once __DIR__ . '/TableCleanup.php';
|
|||
* @ingroup Maintenance
|
||||
*/
|
||||
class CleanupWatchlist extends TableCleanup {
|
||||
/** @inheritDoc */
|
||||
protected $defaultParams = [
|
||||
'table' => 'watchlist',
|
||||
'index' => [ 'wl_id' ],
|
||||
|
|
|
|||
|
|
@ -45,6 +45,7 @@ require_once __DIR__ . '/dumpIterator.php';
|
|||
*/
|
||||
class CompareParsers extends DumpIterator {
|
||||
|
||||
/** @var int */
|
||||
private $count = 0;
|
||||
/** @var string|false */
|
||||
private $saveFailed = false;
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ require_once __DIR__ . '/../vendor/autoload.php';
|
|||
* A PHPParser node visitor that associates each node with its file name.
|
||||
*/
|
||||
class FileAwareNodeVisitor extends PhpParser\NodeVisitorAbstract {
|
||||
/** @var string|null */
|
||||
private $currentFile = null;
|
||||
|
||||
public function enterNode( PhpParser\Node $node ) {
|
||||
|
|
@ -54,8 +55,10 @@ class FileAwareNodeVisitor extends PhpParser\NodeVisitorAbstract {
|
|||
*/
|
||||
class DeprecatedInterfaceFinder extends FileAwareNodeVisitor {
|
||||
|
||||
/** @var string */
|
||||
private $currentClass = null;
|
||||
|
||||
/** @var array[] */
|
||||
private $foundNodes = [];
|
||||
|
||||
public function getFoundNodes() {
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ class GenerateConfigSchema extends Maintenance {
|
|||
private const DEFAULT_ARRAY_PATH = __DIR__ . '/../includes/config-schema.php';
|
||||
private const DEFAULT_SCHEMA_PATH = __DIR__ . '/../docs/config-schema.yaml';
|
||||
private const STDOUT = 'php://stdout';
|
||||
/** @var array */
|
||||
private $settingsArray;
|
||||
|
||||
public function __construct() {
|
||||
|
|
|
|||
|
|
@ -36,8 +36,10 @@ require_once __DIR__ . '/Maintenance.php';
|
|||
*/
|
||||
class GetConfiguration extends Maintenance {
|
||||
|
||||
/** @var string|null */
|
||||
protected $regex = null;
|
||||
|
||||
/** @var array */
|
||||
protected $settings_list = [];
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ require_once __DIR__ . '/../Maintenance.php';
|
|||
* @ingroup Benchmark
|
||||
*/
|
||||
abstract class Benchmarker extends Maintenance {
|
||||
/** @var int */
|
||||
protected $defaultCount = 100;
|
||||
|
||||
public function __construct() {
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@
|
|||
* @codeCoverageIgnore
|
||||
*/
|
||||
class FakeMaintenance extends Maintenance {
|
||||
/** @inheritDoc */
|
||||
protected $mSelf = "FakeMaintenanceScript";
|
||||
|
||||
public function execute() {
|
||||
|
|
|
|||
|
|
@ -50,6 +50,7 @@ class ForkController {
|
|||
/** @var int */
|
||||
protected $procsToStart = 0;
|
||||
|
||||
/** @var int[] */
|
||||
protected static $RESTARTABLE_SIGNALS = [];
|
||||
|
||||
/** @var int[] */
|
||||
|
|
|
|||
|
|
@ -557,7 +557,9 @@ abstract class Maintenance {
|
|||
}
|
||||
}
|
||||
|
||||
/** @var bool */
|
||||
private $atLineStart = true;
|
||||
/** @var string|null */
|
||||
private $lastChannel = null;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -9,7 +9,9 @@ use Wikimedia\Rdbms\IDatabase;
|
|||
* a file.
|
||||
*/
|
||||
class UndoLog {
|
||||
/** @var resource */
|
||||
private $file;
|
||||
/** @var IDatabase */
|
||||
private $dbw;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ require_once __DIR__ . '/Maintenance.php';
|
|||
* @ingroup Maintenance
|
||||
*/
|
||||
class JSParseHelper extends Maintenance {
|
||||
/** @var int */
|
||||
public $errs = 0;
|
||||
|
||||
public function __construct() {
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ require_once __DIR__ . '/Maintenance.php';
|
|||
*/
|
||||
class DatabaseLag extends Maintenance {
|
||||
|
||||
/** @var bool */
|
||||
protected $stopReporting = false;
|
||||
|
||||
public function __construct() {
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ require_once __DIR__ . '/../Maintenance.php';
|
|||
*/
|
||||
class DateFormats extends Maintenance {
|
||||
|
||||
/** @var string */
|
||||
private $ts = '20010115123456';
|
||||
|
||||
public function __construct() {
|
||||
|
|
|
|||
|
|
@ -33,21 +33,24 @@ use Wikimedia\StaticArrayWriter;
|
|||
* @ingroup MaintenanceLanguage
|
||||
*/
|
||||
class GenerateCollationData extends Maintenance {
|
||||
/** The directory with source data files in it */
|
||||
/** @var string The directory with source data files in it */
|
||||
public $dataDir;
|
||||
|
||||
/** The primary weights, indexed by codepoint */
|
||||
/** @var int The primary weights, indexed by codepoint */
|
||||
public $weights;
|
||||
|
||||
/**
|
||||
* A hashtable keyed by codepoint, where presence indicates that a character
|
||||
* has a decomposition mapping. This makes it non-preferred for group header
|
||||
* selection.
|
||||
* @var string[]
|
||||
*/
|
||||
public $mappedChars;
|
||||
|
||||
/** @var string */
|
||||
public $debugOutFile;
|
||||
|
||||
/** @var string[] */
|
||||
private $groups;
|
||||
|
||||
public function __construct() {
|
||||
|
|
@ -300,11 +303,17 @@ class GenerateCollationData extends Maintenance {
|
|||
}
|
||||
|
||||
class UcdXmlReader {
|
||||
/** @var string */
|
||||
public $fileName;
|
||||
/** @var callable */
|
||||
public $callback;
|
||||
/** @var array */
|
||||
public $groupAttrs;
|
||||
/** @var XMLReader */
|
||||
public $xml;
|
||||
/** @var array[] */
|
||||
public $blocks = [];
|
||||
/** @var array */
|
||||
public $currentBlock;
|
||||
|
||||
public function __construct( $fileName ) {
|
||||
|
|
|
|||
|
|
@ -8,10 +8,15 @@ require_once __DIR__ . '/../Maintenance.php';
|
|||
// @codeCoverageIgnoreEnd
|
||||
|
||||
class ImportExtensionMessages extends Maintenance {
|
||||
/** @var string */
|
||||
private $extensionDir;
|
||||
/** @var string */
|
||||
private $extName;
|
||||
/** @var string[] */
|
||||
private $excludedMsgs;
|
||||
/** @var string */
|
||||
private $outDir;
|
||||
/** @var string[] */
|
||||
private $coreDataCache;
|
||||
|
||||
public function __construct() {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
<?php
|
||||
|
||||
use MediaWiki\Parser\Parser;
|
||||
use MediaWiki\Parser\Parsoid\ParsoidParser;
|
||||
use MediaWiki\Title\Title;
|
||||
|
||||
/**
|
||||
|
|
@ -62,6 +64,7 @@ require_once __DIR__ . '/Maintenance.php';
|
|||
* @ingroup Maintenance
|
||||
*/
|
||||
class CLIParser extends Maintenance {
|
||||
/** @var Parser|ParsoidParser */
|
||||
protected $parser;
|
||||
|
||||
public function __construct() {
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ require_once __DIR__ . '/Maintenance.php';
|
|||
*/
|
||||
class PruneFileCache extends Maintenance {
|
||||
|
||||
/** @var int */
|
||||
protected $minSurviveTimestamp;
|
||||
|
||||
public function __construct() {
|
||||
|
|
|
|||
|
|
@ -43,7 +43,9 @@ class PurgeParserCache extends Maintenance {
|
|||
/** @var null|float */
|
||||
private $lastTimestamp;
|
||||
|
||||
/** @var int */
|
||||
private $tmpCount = 0;
|
||||
/** @var float */
|
||||
private $usleep = 0;
|
||||
|
||||
public function __construct() {
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@ require_once __DIR__ . '/Maintenance.php';
|
|||
* @ingroup Maintenance
|
||||
*/
|
||||
class RebuildFileCache extends Maintenance {
|
||||
/** @var bool */
|
||||
private $enabled = true;
|
||||
|
||||
public function __construct() {
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ require_once __DIR__ . '/Maintenance.php';
|
|||
*/
|
||||
class RemoveInvalidEmails extends Maintenance {
|
||||
|
||||
/** @var bool */
|
||||
private $commit = false;
|
||||
|
||||
public function __construct() {
|
||||
|
|
|
|||
|
|
@ -44,6 +44,7 @@ require_once __DIR__ . '/Maintenance.php';
|
|||
*/
|
||||
class DumpRenderer extends Maintenance {
|
||||
|
||||
/** @var int */
|
||||
private $count = 0;
|
||||
private string $outputDirectory;
|
||||
private float $startTime;
|
||||
|
|
|
|||
|
|
@ -59,6 +59,7 @@ class CheckStorage extends Maintenance {
|
|||
$this->check( $fix, $xml );
|
||||
}
|
||||
|
||||
/** @var string[] */
|
||||
public $errorDescriptions = [
|
||||
'restore text' => 'Damaged text, need to be restored from a backup',
|
||||
'restore revision' => 'Damaged revision row, need to be restored from a backup',
|
||||
|
|
|
|||
|
|
@ -59,20 +59,35 @@ $job->execute();
|
|||
* @ingroup Maintenance ExternalStorage
|
||||
*/
|
||||
class RecompressTracked {
|
||||
/** @var string[] */
|
||||
public $destClusters;
|
||||
/** @var int */
|
||||
public $batchSize = 1000;
|
||||
/** @var int */
|
||||
public $orphanBatchSize = 1000;
|
||||
/** @var int */
|
||||
public $reportingInterval = 10;
|
||||
/** @var int */
|
||||
public $numProcs = 1;
|
||||
/** @var int */
|
||||
public $numBatches = 0;
|
||||
/** @var string */
|
||||
public $pageBlobClass;
|
||||
/** @var string */
|
||||
public $orphanBlobClass;
|
||||
/** @var resource[] */
|
||||
public $childPipes;
|
||||
/** @var resource[] */
|
||||
public $childProcs;
|
||||
/** @var int */
|
||||
public $prevChildId;
|
||||
/** @var bool */
|
||||
public $copyOnly = false;
|
||||
/** @var bool */
|
||||
public $isChild = false;
|
||||
/** @var int|false */
|
||||
public $childId = false;
|
||||
/** @var bool */
|
||||
public $noCount = false;
|
||||
public ?string $debugLog = null;
|
||||
public ?string $infoLog = null;
|
||||
|
|
@ -82,6 +97,7 @@ class RecompressTracked {
|
|||
/** @var SqlBlobStore */
|
||||
private $blobStore;
|
||||
|
||||
/** @var string[] */
|
||||
private static $optionsWithArgs = [
|
||||
'procs',
|
||||
'child-id',
|
||||
|
|
@ -90,6 +106,7 @@ class RecompressTracked {
|
|||
'critical-log'
|
||||
];
|
||||
|
||||
/** @var string[] */
|
||||
private static $cmdLineOptionMap = [
|
||||
'no-count' => 'noCount',
|
||||
'procs' => 'numProcs',
|
||||
|
|
@ -691,9 +708,11 @@ class RecompressTracked {
|
|||
class CgzCopyTransaction {
|
||||
/** @var RecompressTracked */
|
||||
public $parent;
|
||||
/** @var string */
|
||||
public $blobClass;
|
||||
/** @var ConcatenatedGzipHistoryBlob|false */
|
||||
public $cgz;
|
||||
/** @var string[] */
|
||||
public $referrers;
|
||||
/** @var array */
|
||||
private $texts;
|
||||
|
|
|
|||
|
|
@ -31,12 +31,18 @@ require_once __DIR__ . '/../Maintenance.php';
|
|||
// @codeCoverageIgnoreEnd
|
||||
|
||||
class TrackBlobs extends Maintenance {
|
||||
/** @var string[] */
|
||||
public $clusters;
|
||||
/** @var IExpression|null */
|
||||
public $textClause;
|
||||
/** @var bool */
|
||||
public $doBlobOrphans;
|
||||
/** @var array */
|
||||
public $trackedBlobs = [];
|
||||
|
||||
/** @var int */
|
||||
public $batchSize = 1000;
|
||||
/** @var int */
|
||||
public $reportingInterval = 10;
|
||||
|
||||
public function __construct() {
|
||||
|
|
|
|||
|
|
@ -85,11 +85,15 @@ class FetchTextTest extends MediaWikiIntegrationTestCase {
|
|||
|
||||
// We add 5 Revisions for this test. Their corresponding text id's
|
||||
// are stored in the following 5 variables.
|
||||
// phpcs:ignore MediaWiki.Commenting.PropertyDocumentation.WrongStyle
|
||||
/** @var int */
|
||||
protected static $textId1;
|
||||
/** @var int */
|
||||
protected static $textId2;
|
||||
/** @var int */
|
||||
protected static $textId3;
|
||||
/** @var int */
|
||||
protected static $textId4;
|
||||
/** @var int */
|
||||
protected static $textId5;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -38,7 +38,9 @@ trait PageDumpTestDataTrait {
|
|||
private Title $pageTitle4;
|
||||
private Title $pageTitle5;
|
||||
|
||||
/** @var int */
|
||||
private static $numOfPages = 4;
|
||||
/** @var int */
|
||||
private static $numOfRevs = 8;
|
||||
|
||||
private RevisionRecord $rev1_1;
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ class MaintenanceRunnerTest extends TestCase {
|
|||
|
||||
public const FIXTURE_DIRECTORY = MW_INSTALL_PATH . '/tests/phpunit/data/MaintenanceRunner';
|
||||
|
||||
/** @var string */
|
||||
private $oldWorkDir;
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue