Code Duplication    Length = 20-20 lines in 2 locations

includes/abstracts/abstract-wc-rest-crud-controller.php 1 location

@@ 591-610 (lines=20) @@
588
			'validate_callback'  => 'rest_validate_request_arg',
589
		);
590
591
		if ( $this->hierarchical ) {
592
			$params['parent'] = array(
593
				'description'       => __( 'Limit result set to those of particular parent IDs.', 'woocommerce' ),
594
				'type'              => 'array',
595
				'items'             => array(
596
					'type'          => 'integer',
597
				),
598
				'sanitize_callback' => 'wp_parse_id_list',
599
				'default'           => array(),
600
			);
601
			$params['parent_exclude'] = array(
602
				'description'       => __( 'Limit result set to all items except those of a particular parent ID.', 'woocommerce' ),
603
				'type'              => 'array',
604
				'items'             => array(
605
					'type'          => 'integer',
606
				),
607
				'sanitize_callback' => 'wp_parse_id_list',
608
				'default'           => array(),
609
			);
610
		}
611
612
		/**
613
		 * Filter collection parameters for the posts controller.

includes/abstracts/abstract-wc-rest-posts-controller.php 1 location

@@ 682-701 (lines=20) @@
679
680
		$post_type_obj = get_post_type_object( $this->post_type );
681
682
		if ( isset( $post_type_obj->hierarchical ) && $post_type_obj->hierarchical ) {
683
			$params['parent'] = array(
684
				'description'       => __( 'Limit result set to those of particular parent IDs.', 'woocommerce' ),
685
				'type'              => 'array',
686
				'items'             => array(
687
					'type'          => 'integer',
688
				),
689
				'sanitize_callback' => 'wp_parse_id_list',
690
				'default'           => array(),
691
			);
692
			$params['parent_exclude'] = array(
693
				'description'       => __( 'Limit result set to all items except those of a particular parent ID.', 'woocommerce' ),
694
				'type'              => 'array',
695
				'items'             => array(
696
					'type'          => 'integer',
697
				),
698
				'sanitize_callback' => 'wp_parse_id_list',
699
				'default'           => array(),
700
			);
701
		}
702
703
		if ( 'wc/v1' === $this->namespace ) {
704
			$params['filter'] = array(