Code Duplication    Length = 12-13 lines in 2 locations

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

@@ 510-522 (lines=13) @@
507
	 *
508
	 * @return array
509
	 */
510
	public function get_collection_params() {
511
		$params = parent::get_collection_params();
512
513
		$params['dp'] = array(
514
			'default'           => 2,
515
			'description'       => __( 'Number of decimal points to use in each resource.', 'woocommerce' ),
516
			'type'              => 'integer',
517
			'sanitize_callback' => 'absint',
518
			'validate_callback' => 'rest_validate_request_arg',
519
		);
520
521
		return $params;
522
	}
523
}
524

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

@@ 647-658 (lines=12) @@
644
	 *
645
	 * @return array
646
	 */
647
	public function get_collection_params() {
648
		$params = parent::get_collection_params();
649
650
		$params['code'] = array(
651
			'description'       => __( 'Limit result set to resources with a specific code.', 'woocommerce' ),
652
			'type'              => 'string',
653
			'sanitize_callback' => 'sanitize_text_field',
654
			'validate_callback' => 'rest_validate_request_arg',
655
		);
656
657
		return $params;
658
	}
659
}
660