Code Duplication    Length = 11-11 lines in 3 locations

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

@@ 42-52 (lines=11) @@
39
	/**
40
	 * Register the routes for customers.
41
	 */
42
	public function register_routes() {
43
		register_rest_route( $this->namespace, '/' . $this->rest_base, array(
44
			array(
45
				'methods'             => WP_REST_Server::READABLE,
46
				'callback'            => array( $this, 'get_items' ),
47
				'permission_callback' => array( $this, 'get_items_permissions_check' ),
48
				'args'                => $this->get_collection_params(),
49
			),
50
			'schema' => array( $this, 'get_public_item_schema' ),
51
		) );
52
	}
53
54
	/**
55
	 * Check whether a given request has permission to read customers.

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

@@ 49-59 (lines=11) @@
46
	/**
47
	 * Register the routes for sales reports.
48
	 */
49
	public function register_routes() {
50
		register_rest_route( $this->namespace, '/' . $this->rest_base, array(
51
			array(
52
				'methods'             => WP_REST_Server::READABLE,
53
				'callback'            => array( $this, 'get_items' ),
54
				'permission_callback' => array( $this, 'get_items_permissions_check' ),
55
				'args'                => $this->get_collection_params(),
56
			),
57
			'schema' => array( $this, 'get_public_item_schema' ),
58
		) );
59
	}
60
61
	/**
62
	 * Check whether a given request has permission to read report.

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

@@ 42-52 (lines=11) @@
39
	/**
40
	 * Register the routes for reports.
41
	 */
42
	public function register_routes() {
43
		register_rest_route( $this->namespace, '/' . $this->rest_base, array(
44
			array(
45
				'methods'             => WP_REST_Server::READABLE,
46
				'callback'            => array( $this, 'get_items' ),
47
				'permission_callback' => array( $this, 'get_items_permissions_check' ),
48
				'args'                => $this->get_collection_params(),
49
			),
50
			'schema' => array( $this, 'get_public_item_schema' ),
51
		) );
52
	}
53
54
	/**
55
	 * Check whether a given request has permission to read reports.