From 10e2f98a17f919cc9d01d64b1d3d5d34bb71d724 Mon Sep 17 00:00:00 2001 From: Umherirrender Date: Wed, 22 Sep 2021 23:09:12 +0200 Subject: [PATCH] import/export: Add documentation for nullable arguments Change-Id: Id8e4553a054a36011433d5705c699d1c2730456e --- includes/export/DumpFilter.php | 6 +++--- includes/export/DumpOutput.php | 4 ++-- includes/export/WikiExporter.php | 2 +- includes/import/WikiImporter.php | 18 +++++++++--------- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/includes/export/DumpFilter.php b/includes/export/DumpFilter.php index c4f80ccb9b2..1abb6fcca88 100644 --- a/includes/export/DumpFilter.php +++ b/includes/export/DumpFilter.php @@ -63,7 +63,7 @@ class DumpFilter { } /** - * @param stdClass $page + * @param stdClass|null $page * @param string $string */ public function writeOpenPage( $page, $string ) { @@ -84,7 +84,7 @@ class DumpFilter { } /** - * @param stdClass $rev + * @param stdClass|null $rev * @param string $string */ public function writeRevision( $rev, $string ) { @@ -127,7 +127,7 @@ class DumpFilter { /** * Override for page-based filter types. - * @param stdClass $page + * @param stdClass|null $page * @return bool */ protected function pass( $page ) { diff --git a/includes/export/DumpOutput.php b/includes/export/DumpOutput.php index bee048c2eca..d547d296b74 100644 --- a/includes/export/DumpOutput.php +++ b/includes/export/DumpOutput.php @@ -43,7 +43,7 @@ class DumpOutput { } /** - * @param stdClass $page + * @param stdClass|null $page * @param string $string */ public function writeOpenPage( $page, $string ) { @@ -58,7 +58,7 @@ class DumpOutput { } /** - * @param stdClass $rev + * @param stdClass|null $rev * @param string $string */ public function writeRevision( $rev, $string ) { diff --git a/includes/export/WikiExporter.php b/includes/export/WikiExporter.php index c1694bcf536..6321e243e1c 100644 --- a/includes/export/WikiExporter.php +++ b/includes/export/WikiExporter.php @@ -511,7 +511,7 @@ class WikiExporter { * and be sorted/grouped by page and revision to avoid duplicate page records in the output. * * @param IResultWrapper $results - * @param stdClass $lastRow the last row output from the previous call (or null if none) + * @param stdClass|null $lastRow the last row output from the previous call (or null if none) * @return stdClass the last row processed */ protected function outputPageStreamBatch( $results, $lastRow ) { diff --git a/includes/import/WikiImporter.php b/includes/import/WikiImporter.php index 5e3763ddf46..eb5cc2ecd67 100644 --- a/includes/import/WikiImporter.php +++ b/includes/import/WikiImporter.php @@ -53,16 +53,16 @@ class WikiImporter { /** @var callable */ private $mUploadCallback; - /** @var callable */ + /** @var callable|null */ private $mRevisionCallback; - /** @var callable */ + /** @var callable|null */ private $mPageCallback; /** @var callable|null */ private $mSiteInfoCallback; - /** @var callable */ + /** @var callable|null */ private $mPageOutCallback; /** @var callable|null */ @@ -284,8 +284,8 @@ class WikiImporter { /** * Sets the action to perform as each new page in the stream is reached. - * @param callable $callback - * @return callable + * @param callable|null $callback + * @return callable|null */ public function setPageCallback( $callback ) { $previous = $this->mPageCallback; @@ -299,8 +299,8 @@ class WikiImporter { * with the original title form (in case it's been overridden into a * local namespace), and a count of revisions. * - * @param callable $callback - * @return callable + * @param callable|null $callback + * @return callable|null */ public function setPageOutCallback( $callback ) { $previous = $this->mPageOutCallback; @@ -310,8 +310,8 @@ class WikiImporter { /** * Sets the action to perform as each page revision is reached. - * @param callable $callback - * @return callable + * @param callable|null $callback + * @return callable|null */ public function setRevisionCallback( $callback ) { $previous = $this->mRevisionCallback;