From b3e4a6f61f314b0933832bc944551866da31773e Mon Sep 17 00:00:00 2001 From: Daimona Eaytoy Date: Sun, 8 Sep 2019 18:59:52 +0200 Subject: [PATCH] Add docblocks to a bunch of methods Copied from I014ea7f048862cc8cc387a68bf0f1cc5acbd9c6e. Change-Id: Ic3216386af173cfb9cbffda0826879829e52ffbb --- includes/debug/logger/ConsoleLogger.php | 6 ++++++ includes/import/ImportStreamSource.php | 3 +++ includes/import/ImportStringSource.php | 3 +++ includes/libs/filebackend/SwiftFileBackend.php | 4 +++- maintenance/cleanupImages.php | 4 ++++ maintenance/preprocessorFuzzTest.php | 3 +++ maintenance/rebuildImages.php | 4 ++++ 7 files changed, 26 insertions(+), 1 deletion(-) diff --git a/includes/debug/logger/ConsoleLogger.php b/includes/debug/logger/ConsoleLogger.php index 5a5e507195..a48faf1e50 100644 --- a/includes/debug/logger/ConsoleLogger.php +++ b/includes/debug/logger/ConsoleLogger.php @@ -10,10 +10,16 @@ use Psr\Log\AbstractLogger; * goal. */ class ConsoleLogger extends AbstractLogger { + /** + * @param string $channel + */ public function __construct( $channel ) { $this->channel = $channel; } + /** + * @inheritDoc + */ public function log( $level, $message, array $context = [] ) { fwrite( STDERR, "[$level] " . LegacyLogger::format( $this->channel, $message, $context ) ); diff --git a/includes/import/ImportStreamSource.php b/includes/import/ImportStreamSource.php index e6936cb2e3..2f8f5dda14 100644 --- a/includes/import/ImportStreamSource.php +++ b/includes/import/ImportStreamSource.php @@ -30,6 +30,9 @@ use MediaWiki\MediaWikiServices; * @ingroup SpecialPage */ class ImportStreamSource implements ImportSource { + /** + * @param resource $handle + */ function __construct( $handle ) { $this->mHandle = $handle; } diff --git a/includes/import/ImportStringSource.php b/includes/import/ImportStringSource.php index 85983b1a11..fdd1f77774 100644 --- a/includes/import/ImportStringSource.php +++ b/includes/import/ImportStringSource.php @@ -32,6 +32,9 @@ * @ingroup SpecialPage */ class ImportStringSource implements ImportSource { + /** + * @param string $string + */ function __construct( $string ) { $this->mString = $string; $this->mRead = false; diff --git a/includes/libs/filebackend/SwiftFileBackend.php b/includes/libs/filebackend/SwiftFileBackend.php index 71442ffee3..edea75f71a 100644 --- a/includes/libs/filebackend/SwiftFileBackend.php +++ b/includes/libs/filebackend/SwiftFileBackend.php @@ -1299,6 +1299,9 @@ class SwiftFileBackend extends FileBackendStore { * @return StatusValue[] */ protected function doExecuteOpHandlesInternal( array $fileOpHandles ) { + /** @var SwiftFileOpHandle[] $fileOpHandles */ + '@phan-var SwiftFileOpHandle[] $fileOpHandles'; + /** @var StatusValue[] $statuses */ $statuses = []; @@ -1314,7 +1317,6 @@ class SwiftFileBackend extends FileBackendStore { // Split the HTTP requests into stages that can be done concurrently $httpReqsByStage = []; // map of (stage => index => HTTP request) foreach ( $fileOpHandles as $index => $fileOpHandle ) { - /** @var SwiftFileOpHandle $fileOpHandle */ $reqs = $fileOpHandle->httpOp; // Convert the 'url' parameter to an actual URL using $auth foreach ( $reqs as $stage => &$req ) { diff --git a/maintenance/cleanupImages.php b/maintenance/cleanupImages.php index 305a41dddc..4d0c0e6729 100644 --- a/maintenance/cleanupImages.php +++ b/maintenance/cleanupImages.php @@ -111,6 +111,10 @@ class CleanupImages extends TableCleanup { } } + /** + * @param string $name + * @return string + */ private function filePath( $name ) { if ( !isset( $this->repo ) ) { $this->repo = RepoGroup::singleton()->getLocalRepo(); diff --git a/maintenance/preprocessorFuzzTest.php b/maintenance/preprocessorFuzzTest.php index 68fb6435a5..39b2ff03e8 100644 --- a/maintenance/preprocessorFuzzTest.php +++ b/maintenance/preprocessorFuzzTest.php @@ -150,6 +150,9 @@ class PPFuzzTester { class PPFuzzTest { public $templates, $mainText, $title, $entryPoint, $output; + /** + * @param PPFuzzTester $tester + */ function __construct( $tester ) { global $wgMaxSigChars; $this->parent = $tester; diff --git a/maintenance/rebuildImages.php b/maintenance/rebuildImages.php index bfbee9b65b..3de0070859 100644 --- a/maintenance/rebuildImages.php +++ b/maintenance/rebuildImages.php @@ -91,6 +91,10 @@ class ImageBuilder extends Maintenance { $this->buildOldImage(); } + /** + * @param int $count + * @param string $table + */ function init( $count, $table ) { $this->processed = 0; $this->updated = 0; -- 2.20.1