From a6dce8b8cd0b665ed4a00ad6bdcfabf69f2925c3 Mon Sep 17 00:00:00 2001 From: Lucas Werkmeister Date: Tue, 11 Jun 2019 14:35:23 +0200 Subject: [PATCH] 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 --- includes/filerepo/file/File.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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 */ -- 2.20.1