Code Duplication    Length = 3-3 lines in 3 locations

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

@@ 139-141 (lines=3) @@
136
		}
137
138
		// Format date values.
139
		foreach ( $format_date as $key ) {
140
			$data[ $key ] = $data[ $key ] ? wc_rest_prepare_date_response( get_gmt_from_date( date( 'Y-m-d H:i:s', $data[ $key ] ) ) ) : false;
141
		}
142
143
		// Format line items.
144
		foreach ( $format_line_items as $key ) {

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

@@ 202-204 (lines=3) @@
199
		}
200
201
		// Format date values.
202
		foreach ( $format_date as $key ) {
203
			$data[ $key ] = $data[ $key ] ? wc_rest_prepare_date_response( get_gmt_from_date( date( 'Y-m-d H:i:s', $data[ $key ] ) ) ) : false;
204
		}
205
206
		// Format the order status.
207
		$data['status'] = 'wc-' === substr( $data['status'], 0, 3 ) ? substr( $data['status'], 3 ) : $data['status'];

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

@@ 155-157 (lines=3) @@
152
		}
153
154
		// Format date values.
155
		foreach ( $format_date as $key ) {
156
			$data[ $key ] = $data[ $key ] ? wc_rest_prepare_date_response( get_gmt_from_date( date( 'Y-m-d H:i:s', $data[ $key ] ) ) ) : false;
157
		}
158
159
		$context  = ! empty( $request['context'] ) ? $request['context'] : 'view';
160
		$data     = $this->add_additional_fields_to_object( $data, $request );