Code Duplication    Length = 9-10 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-external-media.php 1 location

@@ 29-38 (lines=10) @@
26
	/**
27
	 * Register the route.
28
	 */
29
	public function register_routes() {
30
		register_rest_route(
31
			$this->namespace,
32
			$this->rest_base . '/list/(?P<service>google_photos|pexels)',
33
			array(
34
				'methods'  => WP_REST_Server::READABLE,
35
				'callback' => array( $this, 'get_external_media' ),
36
			)
37
		);
38
	}
39
40
	public function get_external_media( \WP_REST_Request $request ) {
41
		$params = $request->get_params();