Code Duplication    Length = 15-15 lines in 2 locations

includes/resourceloader/ResourceLoader.php 2 locations

@@ 1225-1239 (lines=15) @@
1222
	 * @param string $state
1223
	 * @return string
1224
	 */
1225
	public static function makeLoaderStateScript( $name, $state = null ) {
1226
		if ( is_array( $name ) ) {
1227
			return Xml::encodeJsCall(
1228
				'mw.loader.state',
1229
				[ $name ],
1230
				ResourceLoader::inDebugMode()
1231
			);
1232
		} else {
1233
			return Xml::encodeJsCall(
1234
				'mw.loader.state',
1235
				[ $name, $state ],
1236
				ResourceLoader::inDebugMode()
1237
			);
1238
		}
1239
	}
1240
1241
	/**
1242
	 * Returns JS code which calls the script given by $script. The script will
@@ 1381-1395 (lines=15) @@
1378
	 * @param string $loadUrl load.php url
1379
	 * @return string
1380
	 */
1381
	public static function makeLoaderSourcesScript( $id, $loadUrl = null ) {
1382
		if ( is_array( $id ) ) {
1383
			return Xml::encodeJsCall(
1384
				'mw.loader.addSource',
1385
				[ $id ],
1386
				ResourceLoader::inDebugMode()
1387
			);
1388
		} else {
1389
			return Xml::encodeJsCall(
1390
				'mw.loader.addSource',
1391
				[ $id, $loadUrl ],
1392
				ResourceLoader::inDebugMode()
1393
			);
1394
		}
1395
	}
1396
1397
	/**
1398
	 * Returns JS code which runs given JS code if the client-side framework is