Code Duplication    Length = 11-11 lines in 2 locations

includes/context/DerivativeContext.php 1 location

@@ 271-281 (lines=11) @@
268
	 * @throws MWException
269
	 * @since 1.19
270
	 */
271
	public function setLanguage( $l ) {
272
		if ( $l instanceof Language ) {
273
			$this->lang = $l;
274
		} elseif ( is_string( $l ) ) {
275
			$l = RequestContext::sanitizeLangCode( $l );
276
			$obj = Language::factory( $l );
277
			$this->lang = $obj;
278
		} else {
279
			throw new MWException( __METHOD__ . " was passed an invalid type of data." );
280
		}
281
	}
282
283
	/**
284
	 * Get the Language object

includes/context/RequestContext.php 1 location

@@ 326-336 (lines=11) @@
323
	 * @throws MWException
324
	 * @since 1.19
325
	 */
326
	public function setLanguage( $l ) {
327
		if ( $l instanceof Language ) {
328
			$this->lang = $l;
329
		} elseif ( is_string( $l ) ) {
330
			$l = self::sanitizeLangCode( $l );
331
			$obj = Language::factory( $l );
332
			$this->lang = $obj;
333
		} else {
334
			throw new MWException( __METHOD__ . " was passed an invalid type of data." );
335
		}
336
	}
337
338
	/**
339
	 * Get the Language object.