Add docblocks to a bunch of methods
authorDaimona Eaytoy <daimona.wiki@gmail.com>
Sun, 8 Sep 2019 16:59:52 +0000 (18:59 +0200)
committerKrinkle <krinklemail@gmail.com>
Sun, 8 Sep 2019 18:33:31 +0000 (18:33 +0000)
Copied from I014ea7f048862cc8cc387a68bf0f1cc5acbd9c6e.

Change-Id: Ic3216386af173cfb9cbffda0826879829e52ffbb

includes/debug/logger/ConsoleLogger.php
includes/import/ImportStreamSource.php
includes/import/ImportStringSource.php
includes/libs/filebackend/SwiftFileBackend.php
maintenance/cleanupImages.php
maintenance/preprocessorFuzzTest.php
maintenance/rebuildImages.php

index 5a5e507..a48faf1 100644 (file)
@@ -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 ) );
index e6936cb..2f8f5dd 100644 (file)
@@ -30,6 +30,9 @@ use MediaWiki\MediaWikiServices;
  * @ingroup SpecialPage
  */
 class ImportStreamSource implements ImportSource {
+       /**
+        * @param resource $handle
+        */
        function __construct( $handle ) {
                $this->mHandle = $handle;
        }
index 85983b1..fdd1f77 100644 (file)
@@ -32,6 +32,9 @@
  * @ingroup SpecialPage
  */
 class ImportStringSource implements ImportSource {
+       /**
+        * @param string $string
+        */
        function __construct( $string ) {
                $this->mString = $string;
                $this->mRead = false;
index 71442ff..edea75f 100644 (file)
@@ -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 ) {
index 305a41d..4d0c0e6 100644 (file)
@@ -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();
index 68fb643..39b2ff0 100644 (file)
@@ -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;
index bfbee9b..3de0070 100644 (file)
@@ -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;