From: Siebrand Mazeland Date: Fri, 27 Dec 2013 17:00:39 +0000 (+0100) Subject: Throw exception when ArchivedFile::getUser() has unkown type X-Git-Tag: 1.31.0-rc.0~17477^2 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/modifier.php?a=commitdiff_plain;h=670c90d285d17e4e10003b82094921240cae6e8a;p=lhc%2Fweb%2Fwiklou.git Throw exception when ArchivedFile::getUser() has unkown type Change-Id: I95117c5cc73d187c8c7b859b67ad6655d196d91e --- diff --git a/includes/filerepo/file/ArchivedFile.php b/includes/filerepo/file/ArchivedFile.php index 012dd845e7..26699c4260 100644 --- a/includes/filerepo/file/ArchivedFile.php +++ b/includes/filerepo/file/ArchivedFile.php @@ -458,6 +458,7 @@ class ArchivedFile { * the rest of the file classes. * @param string $type 'text' or 'id' * @return int|string + * @throws MWException */ public function getUser( $type = 'text' ) { $this->load(); @@ -467,6 +468,9 @@ class ArchivedFile { } elseif ( $type == 'id' ) { return $this->user; } + + throw new MWException( "Unknown type '$type'." ); + } /**