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

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