Merge "Improve type hints in export related classes"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Thu, 25 Jul 2019 21:42:32 +0000 (21:42 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Thu, 25 Jul 2019 21:42:32 +0000 (21:42 +0000)
includes/api/ApiImportReporter.php
includes/export/DumpFileOutput.php
includes/export/WikiExporter.php
includes/import/WikiImporter.php
includes/import/WikiRevision.php

index 21d9d23..be53c67 100644 (file)
@@ -29,13 +29,13 @@ class ApiImportReporter extends ImportReporter {
 
        /**
         * @param Title $title
-        * @param Title $origTitle
+        * @param ForeignTitle $foreignTitle
         * @param int $revisionCount
         * @param int $successCount
         * @param array $pageInfo
         * @return void
         */
-       public function reportPage( $title, $origTitle, $revisionCount, $successCount, $pageInfo ) {
+       public function reportPage( $title, $foreignTitle, $revisionCount, $successCount, $pageInfo ) {
                // Add a result entry
                $r = [];
 
@@ -51,7 +51,7 @@ class ApiImportReporter extends ImportReporter {
                $this->mResultArr[] = $r;
 
                // Piggyback on the parent to do the logging
-               parent::reportPage( $title, $origTitle, $revisionCount, $successCount, $pageInfo );
+               parent::reportPage( $title, $foreignTitle, $revisionCount, $successCount, $pageInfo );
        }
 
        public function getData() {
index 4bec7d4..d0256fd 100644 (file)
  * @ingroup Dump
  */
 class DumpFileOutput extends DumpOutput {
-       protected $handle = false, $filename;
+       /** @var resource|false */
+       protected $handle = false;
+       /** @var string */
+       protected $filename;
 
        /**
         * @param string $file
@@ -73,7 +76,7 @@ class DumpFileOutput extends DumpOutput {
        }
 
        /**
-        * @param array $newname
+        * @param string|string[] $newname
         * @return string
         * @throws MWException
         */
index fe6dadf..3ab88e2 100644 (file)
@@ -125,7 +125,7 @@ class WikiExporter {
         * various row objects and XML output for filtering. Filters
         * can be chained or used as callbacks.
         *
-        * @param DumpOutput &$sink
+        * @param DumpOutput|DumpFilter &$sink
         */
        public function setOutputSink( &$sink ) {
                $this->sink =& $sink;
@@ -240,7 +240,7 @@ class WikiExporter {
         * Not called by default (depends on $this->list_authors)
         * Can be set by Special:Export when not exporting whole history
         *
-        * @param array $cond
+        * @param string $cond
         */
        protected function do_list_authors( $cond ) {
                $this->author_list = "<contributors>";
index 00bb61f..68f5b9b 100644 (file)
@@ -466,7 +466,7 @@ class WikiImporter {
 
        /**
         * Notify the callback function when a new "<page>" is reached.
-        * @param Title $title
+        * @param array $title
         */
        function pageCallback( $title ) {
                if ( isset( $this->mPageCallback ) ) {
index cae9542..e36d673 100644 (file)
@@ -352,7 +352,7 @@ class WikiRevision implements ImportableUploadRevision, ImportableOldRevision {
 
        /**
         * @since 1.12.2
-        * @param array $params
+        * @param string $params
         */
        public function setParams( $params ) {
                $this->params = $params;