Throw exception when ArchivedFile::getUser() has unkown type
authorSiebrand Mazeland <s.mazeland@xs4all.nl>
Fri, 27 Dec 2013 17:00:39 +0000 (18:00 +0100)
committerSiebrand <siebrand@wikimedia.org>
Fri, 27 Dec 2013 17:05:44 +0000 (17:05 +0000)
Change-Id: I95117c5cc73d187c8c7b859b67ad6655d196d91e

includes/filerepo/file/ArchivedFile.php

index 012dd84..26699c4 100644 (file)
@@ -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'." );
+
        }
 
        /**