Code Duplication    Length = 10-15 lines in 2 locations

_inc/lib/core-api/wpcom-endpoints/gutenberg-available-extensions.php 1 location

@@ 25-34 (lines=10) @@
22
		add_action( 'rest_api_init', array( $this, 'register_routes' ) );
23
	}
24
25
	public function register_routes() {
26
		register_rest_route( $this->namespace, $this->rest_base . '/available-extensions', array(
27
			array(
28
				'methods'             => WP_REST_Server::READABLE,
29
				'callback'            => array( 'Jetpack_Gutenberg', 'get_availability' ),
30
				'permission_callback' => array( $this, 'get_items_permission_check' ),
31
			),
32
			'schema' => array( $this, 'get_item_schema' ),
33
		 ) );
34
	}
35
36
	/**
37
	 * Return the available Gutenberg extensions schema

modules/search/class.jetpack-search-local-endpoint.php 1 location

@@ 4-18 (lines=15) @@
1
<?php
2
3
class Jetpack_Search_Local_Endpoint {
4
	public function register_routes() {
5
		register_rest_route(
6
			'jetpack/v4',
7
			'/search-local',
8
			array(
9
				array(
10
					'methods'             => WP_REST_Server::READABLE,
11
					'callback'            => array( $this, 'get_items' ),
12
					'permission_callback' => array( $this, 'get_items_permissions_check' ),
13
					'args'                => $this->get_request_args(),
14
				),
15
				'schema' => array( $this, 'get_schema' ),
16
			)
17
		);
18
	}
19
20
	public function get_request_args() {
21
		return array(