Code Duplication    Length = 11-11 lines in 2 locations

wp-includes/rest-api.php 2 locations

@@ 350-360 (lines=11) @@
347
 * @param string $replacement The function that should have been called.
348
 * @param string $version     Version.
349
 */
350
function rest_handle_deprecated_function( $function, $replacement, $version ) {
351
	if ( ! empty( $replacement ) ) {
352
		/* translators: 1: function name, 2: WordPress version number, 3: new function name */
353
		$string = sprintf( __( '%1$s (since %2$s; use %3$s instead)' ), $function, $version, $replacement );
354
	} else {
355
		/* translators: 1: function name, 2: WordPress version number */
356
		$string = sprintf( __( '%1$s (since %2$s; no alternative available)' ), $function, $version );
357
	}
358
359
	header( sprintf( 'X-WP-DeprecatedFunction: %s', $string ) );
360
}
361
362
/**
363
 * Handles _deprecated_argument() errors.
@@ 371-381 (lines=11) @@
368
 * @param string $message     A message regarding the change.
369
 * @param string $version     Version.
370
 */
371
function rest_handle_deprecated_argument( $function, $message, $version ) {
372
	if ( ! empty( $message ) ) {
373
		/* translators: 1: function name, 2: WordPress version number, 3: error message */
374
		$string = sprintf( __( '%1$s (since %2$s; %3$s)' ), $function, $version, $message );
375
	} else {
376
		/* translators: 1: function name, 2: WordPress version number */
377
		$string = sprintf( __( '%1$s (since %2$s; no alternative available)' ), $function, $version );
378
	}
379
380
	header( sprintf( 'X-WP-DeprecatedParam: %s', $string ) );
381
}
382
383
/**
384
 * Sends Cross-Origin Resource Sharing headers with API requests.