Code Duplication    Length = 3-3 lines in 3 locations

includes/cli/class-wc-cli-product.php 1 location

@@ 2023-2025 (lines=3) @@
2020
			'timeout' => 10
2021
		) );
2022
2023
		if ( is_wp_error( $response ) || 200 !== wp_remote_retrieve_response_code( $response ) ) {
2024
			throw new WC_CLI_Exception( 'woocommerce_cli_invalid_remote_product_image', sprintf( __( 'Error getting remote image %s', 'woocommerce' ), $image_url ) );
2025
		}
2026
2027
		// Ensure we have a file name and type
2028
		if ( ! $wp_filetype['type'] ) {

includes/wc-rest-functions.php 1 location

@@ 73-75 (lines=3) @@
70
		'timeout' => 10
71
	) );
72
73
	if ( is_wp_error( $response ) || 200 !== wp_remote_retrieve_response_code( $response ) ) {
74
		return new WP_Error( 'woocommerce_rest_invalid_remote_image_url', sprintf( __( 'Error getting remote image %s.', 'woocommerce' ), $image_url ), array( 'status' => 400 ) );
75
	}
76
77
	// Ensure we have a file name and type.
78
	if ( ! $wp_filetype['type'] ) {

includes/api/class-wc-rest-taxes-controller.php 1 location

@@ 546-548 (lines=3) @@
543
544
		// Limit bulk operation.
545
		$limit = apply_filters( 'woocommerce_rest_bulk_items_limit', 100, 'taxes' );
546
		if ( count( $items ) > $limit ) {
547
			return new WP_Error( 'woocommerce_rest_request_entity_too_large', sprintf( __( 'Unable to accept more than %s items for this request.', 'woocommerce' ), $limit ), array( 'status' => 413 ) );
548
		}
549
550
		$response = array();
551