From: Daimona Eaytoy Date: Sun, 15 Sep 2019 09:10:29 +0000 (+0200) Subject: export: Align docs of close(Rename/Reopen) methods X-Git-Tag: 1.34.0-rc.0~149^2 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/membres/fiche.php?a=commitdiff_plain;h=1927fda9093fdccea5541f4621591ee4e3d55282;p=lhc%2Fweb%2Fwiklou.git export: Align docs of close(Rename/Reopen) methods 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 --- diff --git a/includes/export/Dump7ZipOutput.php b/includes/export/Dump7ZipOutput.php index a50150e085..833d553696 100644 --- a/includes/export/Dump7ZipOutput.php +++ b/includes/export/Dump7ZipOutput.php @@ -60,8 +60,7 @@ class Dump7ZipOutput extends DumpPipeOutput { } /** - * @param string $newname - * @param bool $open + * @inheritDoc */ function closeAndRename( $newname, $open = false ) { $newname = $this->checkRenameArgCount( $newname ); diff --git a/includes/export/DumpFileOutput.php b/includes/export/DumpFileOutput.php index d0256fd877..ad68109999 100644 --- a/includes/export/DumpFileOutput.php +++ b/includes/export/DumpFileOutput.php @@ -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 ); diff --git a/includes/export/DumpFilter.php b/includes/export/DumpFilter.php index 75e149cea3..143fb8efe8 100644 --- a/includes/export/DumpFilter.php +++ b/includes/export/DumpFilter.php @@ -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 ) { diff --git a/includes/export/DumpOutput.php b/includes/export/DumpOutput.php index ab925b75ff..5c15c5f9c0 100644 --- a/includes/export/DumpOutput.php +++ b/includes/export/DumpOutput.php @@ -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) */ diff --git a/includes/export/DumpPipeOutput.php b/includes/export/DumpPipeOutput.php index 0521c5a131..4e61434f50 100644 --- a/includes/export/DumpPipeOutput.php +++ b/includes/export/DumpPipeOutput.php @@ -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 );