Code Duplication    Length = 9-12 lines in 2 locations

_inc/lib/core-api/wpcom-endpoints/business-hours.php 1 location

@@ 16-24 (lines=9) @@
13
		add_action( 'rest_api_init', array( $this, 'register_routes' ) );
14
	}
15
16
	public function register_routes() {
17
		// GET /sites/<blog_id>/business-hours/localized-week - Return the localized
18
		register_rest_route( $this->namespace, '/' . $this->rest_base . '/localized-week', array(
19
			array(
20
				'methods'  => WP_REST_Server::READABLE,
21
				'callback' => array( $this, 'get_localized_week' ),
22
			)
23
		) );
24
	}
25
26
	/**
27
	 * Retreives localized business hours

_inc/lib/core-api/wpcom-endpoints/class-wpcom-rest-api-v2-endpoint-mailchimp.php 1 location

@@ 22-33 (lines=12) @@
19
	/**
20
	 * Called automatically on `rest_api_init()`.
21
	 */
22
	public function register_routes() {
23
		register_rest_route(
24
			$this->namespace,
25
			$this->rest_base,
26
			array(
27
				array(
28
					'methods'  => WP_REST_Server::READABLE,
29
					'callback' => array( $this, 'get_mailchimp_status' ),
30
				),
31
			)
32
		);
33
	}
34
35
	/**
36
	 * Check if MailChimp is set up properly.