Fix return type of File::restore()
authorLucas Werkmeister <lucas.werkmeister@wikimedia.de>
Tue, 11 Jun 2019 12:35:23 +0000 (14:35 +0200)
committerLucas Werkmeister <lucas.werkmeister@wikimedia.de>
Tue, 11 Jun 2019 12:41:13 +0000 (14:41 +0200)
commita6dce8b8cd0b665ed4a00ad6bdcfabf69f2925c3
treeed83a3fb1e81c247dab5eb8449bf2b6368400fd5
parent6ceb894b88fac3472d1fda8afaa187745c175ec1
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