Code Duplication    Length = 12-13 lines in 2 locations

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

@@ 571-582 (lines=12) @@
568
	 *
569
	 * @return array
570
	 */
571
	public function get_collection_params() {
572
		$params = parent::get_collection_params();
573
574
		$params['code'] = array(
575
			'description'       => __( 'Limit result set to resources with a specific code.', 'woocommerce' ),
576
			'type'              => 'string',
577
			'sanitize_callback' => 'sanitize_text_field',
578
			'validate_callback' => 'rest_validate_request_arg',
579
		);
580
581
		return $params;
582
	}
583
}
584

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

@@ 502-514 (lines=13) @@
499
	 *
500
	 * @return array
501
	 */
502
	public function get_collection_params() {
503
		$params = parent::get_collection_params();
504
505
		$params['dp'] = array(
506
			'default'           => 2,
507
			'description'       => __( 'Number of decimal points to use in each resource.', 'woocommerce' ),
508
			'type'              => 'integer',
509
			'sanitize_callback' => 'absint',
510
			'validate_callback' => 'rest_validate_request_arg',
511
		);
512
513
		return $params;
514
	}
515
}
516