export: Align docs of close(Rename/Reopen) methods
authorDaimona Eaytoy <daimona.wiki@gmail.com>
Sun, 15 Sep 2019 09:10:29 +0000 (11:10 +0200)
committerUmherirrender <umherirrender_de.wp@web.de>
Thu, 19 Sep 2019 17:29:30 +0000 (17:29 +0000)
The base implementation says it can accept an array with a single
element, but the subclasses only had `string` in the docblock (although
they could handle the array case). Hence, replace docblocks in
subclasses with @inheritDoc to copy the parent description and avoid
such discrepancies in the future.

Plus, change `array` to `string[]` for better type inference.

Change-Id: Ica9929fd50f31d8d5f0e29f7c60364086ea39ae5

includes/export/Dump7ZipOutput.php
includes/export/DumpFileOutput.php
includes/export/DumpFilter.php
includes/export/DumpOutput.php
includes/export/DumpPipeOutput.php

index a50150e..833d553 100644 (file)
@@ -60,8 +60,7 @@ class Dump7ZipOutput extends DumpPipeOutput {
        }
 
        /**
-        * @param string $newname
-        * @param bool $open
+        * @inheritDoc
         */
        function closeAndRename( $newname, $open = false ) {
                $newname = $this->checkRenameArgCount( $newname );
index d0256fd..ad68109 100644 (file)
@@ -59,7 +59,7 @@ class DumpFileOutput extends DumpOutput {
        }
 
        /**
-        * @param string $newname
+        * @inheritDoc
         */
        function closeRenameAndReopen( $newname ) {
                $this->closeAndRename( $newname, true );
@@ -92,8 +92,7 @@ class DumpFileOutput extends DumpOutput {
        }
 
        /**
-        * @param string $newname
-        * @param bool $open
+        * @inheritDoc
         */
        function closeAndRename( $newname, $open = false ) {
                $newname = $this->checkRenameArgCount( $newname );
index 75e149c..143fb8e 100644 (file)
@@ -102,14 +102,16 @@ class DumpFilter {
        }
 
        /**
-        * @param string $newname
+        * @see DumpOutput::closeRenameAndReopen()
+        * @param string|string[] $newname
         */
        function closeRenameAndReopen( $newname ) {
                $this->sink->closeRenameAndReopen( $newname );
        }
 
        /**
-        * @param string $newname
+        * @see DumpOutput::closeAndRename()
+        * @param string|string[] $newname
         * @param bool $open
         */
        function closeAndRename( $newname, $open = false ) {
index ab925b7..5c15c5f 100644 (file)
@@ -86,7 +86,7 @@ class DumpOutput {
         * and reopen new file with the old name. Use this
         * for writing out a file in multiple pieces
         * at specified checkpoints (e.g. every n hours).
-        * @param string|array $newname File name. May be a string or an array with one element
+        * @param string|string[] $newname File name. May be a string or an array with one element
         */
        function closeRenameAndReopen( $newname ) {
        }
@@ -95,7 +95,7 @@ class DumpOutput {
         * Close the old file, and move it to a specified name.
         * Use this for the last piece of a file written out
         * at specified checkpoints (e.g. every n hours).
-        * @param string|array $newname File name. May be a string or an array with one element
+        * @param string|string[] $newname File name. May be a string or an array with one element
         * @param bool $open If true, a new file with the old filename will be opened
         *   again for writing (default: false)
         */
index 0521c5a..4e61434 100644 (file)
@@ -73,15 +73,14 @@ class DumpPipeOutput extends DumpFileOutput {
        }
 
        /**
-        * @param string $newname
+        * @inheritDoc
         */
        function closeRenameAndReopen( $newname ) {
                $this->closeAndRename( $newname, true );
        }
 
        /**
-        * @param string $newname
-        * @param bool $open
+        * @inheritDoc
         */
        function closeAndRename( $newname, $open = false ) {
                $newname = $this->checkRenameArgCount( $newname );