Code Duplication    Length = 7-7 lines in 2 locations

includes/Hooks.php 1 location

@@ 66-72 (lines=7) @@
63
	 * @since 1.21
64
	 * @throws MWException If not in testing mode.
65
	 */
66
	public static function clear( $name ) {
67
		if ( !defined( 'MW_PHPUNIT_TEST' ) && !defined( 'MW_PARSER_TEST' ) ) {
68
			throw new MWException( 'Cannot reset hooks in operation.' );
69
		}
70
71
		unset( self::$handlers[$name] );
72
	}
73
74
	/**
75
	 * Returns true if a hook has a function registered to it.

includes/MediaWikiServices.php 1 location

@@ 323-329 (lines=7) @@
320
	 *
321
	 * @throws MWException if called outside of PHPUnit tests.
322
	 */
323
	public function resetServiceForTesting( $name, $destroy = true ) {
324
		if ( !defined( 'MW_PHPUNIT_TEST' ) && !defined( 'MW_PARSER_TEST' ) ) {
325
			throw new MWException( 'resetServiceForTesting() must not be used outside unit tests.' );
326
		}
327
328
		$this->resetService( $name, $destroy );
329
	}
330
331
	/**
332
	 * Convenience method that throws an exception unless it is called during a phase in which