Code Duplication    Length = 6-7 lines in 3 locations

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

@@ 11-16 (lines=6) @@
8
 * @since 7.1
9
 */
10
class WPCOM_REST_API_V2_Endpoint_Mailchimp extends WP_REST_Controller {
11
	public function __construct() {
12
		$this->namespace                    = 'wpcom/v2';
13
		$this->rest_base                    = 'mailchimp';
14
		$this->wpcom_is_wpcom_only_endpoint = true;
15
16
		add_action( 'rest_api_init', array( $this, 'register_routes' ) );
17
	}
18
19
	/**

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

@@ 17-23 (lines=7) @@
14
 * @since 6.9
15
 */
16
class WPCOM_REST_API_V2_Endpoint_Gutenberg_Available_Extensions extends WP_REST_Controller {
17
	function __construct() {
18
		$this->namespace = 'wpcom/v2';
19
		$this->rest_base = 'gutenberg';
20
		$this->wpcom_is_site_specific_endpoint = true;
21
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(

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

@@ 9-15 (lines=7) @@
6
 * @since 6.9
7
 */
8
class WPCOM_REST_API_V2_Endpoint_Subscribers extends WP_REST_Controller {
9
	function __construct() {
10
		$this->namespace = 'wpcom/v2';
11
		$this->rest_base = 'subscribers';
12
		// This endpoint *does not* need to connect directly to Jetpack sites.
13
		$this->wpcom_is_wpcom_only_endpoint = true;
14
		add_action( 'rest_api_init', array( $this, 'register_routes' ) );
15
	}
16
17
	public function register_routes() {
18
		// GET /sites/<blog_id>/subscribers/count - Return number of subscribers for this site.