From f5fa7a94d912cba104010538e971f2dc13c17786 Mon Sep 17 00:00:00 2001 From: Umherirrender Date: Sat, 29 Jun 2019 18:00:56 +0200 Subject: [PATCH] Improve type hints in export related classes Change-Id: I3a11173bc96611c69cdc615eba741c6e4f92824a --- includes/api/ApiImportReporter.php | 6 +++--- includes/export/DumpFileOutput.php | 7 +++++-- includes/export/WikiExporter.php | 4 ++-- includes/import/WikiImporter.php | 2 +- includes/import/WikiRevision.php | 2 +- 5 files changed, 12 insertions(+), 9 deletions(-) diff --git a/includes/api/ApiImportReporter.php b/includes/api/ApiImportReporter.php index 21d9d235dc..be53c67c33 100644 --- a/includes/api/ApiImportReporter.php +++ b/includes/api/ApiImportReporter.php @@ -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() { diff --git a/includes/export/DumpFileOutput.php b/includes/export/DumpFileOutput.php index 4bec7d4532..d0256fd877 100644 --- a/includes/export/DumpFileOutput.php +++ b/includes/export/DumpFileOutput.php @@ -27,7 +27,10 @@ * @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 */ diff --git a/includes/export/WikiExporter.php b/includes/export/WikiExporter.php index f834fb1e5e..05c28fbfbe 100644 --- a/includes/export/WikiExporter.php +++ b/includes/export/WikiExporter.php @@ -112,7 +112,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; @@ -227,7 +227,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 = ""; diff --git a/includes/import/WikiImporter.php b/includes/import/WikiImporter.php index 00bb61f7b2..68f5b9b8bf 100644 --- a/includes/import/WikiImporter.php +++ b/includes/import/WikiImporter.php @@ -466,7 +466,7 @@ class WikiImporter { /** * Notify the callback function when a new "" is reached. - * @param Title $title + * @param array $title */ function pageCallback( $title ) { if ( isset( $this->mPageCallback ) ) { diff --git a/includes/import/WikiRevision.php b/includes/import/WikiRevision.php index c006874aec..308d614c6b 100644 --- a/includes/import/WikiRevision.php +++ b/includes/import/WikiRevision.php @@ -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; -- 2.20.1