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

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