From: Lucas Werkmeister Date: Tue, 11 Jun 2019 12:35:23 +0000 (+0200) Subject: Fix return type of File::restore() X-Git-Tag: 1.34.0-rc.0~1458^2 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dcompta/comptes/journal.php?a=commitdiff_plain;h=a6dce8b8cd0b665ed4a00ad6bdcfabf69f2925c3;p=lhc%2Fweb%2Fwiklou.git Fix return type of File::restore() The only real implementation, LocalFile::restore(), has not returned an int|bool since commit ca76169bbe, almost twelve years ago. (MediaWiki code search [1] finds no other implementations.) This discrepancy became more visible when we moved from wfLocalFile() to FileRepo::findFile(), because wfLocalFile() (incorrectly, as it just calls FileRepo::findFile()) is declared to return a LocalFile, rather than any File as FileRepo::findFile() does, so the incorrect return type on File::returnType() was not seen by wfLocalFile() users. [1]: https://codesearch.wmflabs.org/search/?q=function%20restore\(&files=\.php%24 Change-Id: Idaf73074eaddc5be1782ae484d75a0f0c129b980 --- diff --git a/includes/filerepo/file/File.php b/includes/filerepo/file/File.php index 55c50538dd..124afef681 100644 --- a/includes/filerepo/file/File.php +++ b/includes/filerepo/file/File.php @@ -1953,8 +1953,7 @@ abstract class File implements IDBAccessObject { * @param array $versions Set of record ids of deleted items to restore, * or empty to restore all revisions. * @param bool $unsuppress Remove restrictions on content upon restoration? - * @return int|bool The number of file revisions restored if successful, - * or false on failure + * @return Status * STUB * Overridden by LocalFile */