Merge "Add final tests for the Status class"
[lhc/web/wiklou.git] / includes / context / DerivativeContext.php
index d4caf05..e96269d 100644 (file)
@@ -99,8 +99,12 @@ class DerivativeContext extends ContextSource {
         * Set the Title object
         *
         * @param Title $t
+        * @throws MWException
         */
-       public function setTitle( Title $t ) {
+       public function setTitle( $t ) {
+               if ( $t !== null && !$t instanceof Title ) {
+                       throw new MWException( __METHOD__ . " expects an instance of Title" );
+               }
                $this->title = $t;
        }
 
@@ -295,6 +299,7 @@ class DerivativeContext extends ContextSource {
         */
        public function msg() {
                $args = func_get_args();
+
                return call_user_func_array( 'wfMessage', $args )->setContext( $this );
        }
 }