Code Duplication    Length = 13-13 lines in 2 locations

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

@@ 128-140 (lines=13) @@
125
	 * @param WP_REST_Request $request
126
	 * @return WP_REST_Response suitable for 1-page collection
127
	 */
128
	public function get_items( $request ) {
129
		$items = array();
130
131
		foreach ( $this->get_connections() as $item ) {
132
			$items[] = $this->prepare_item_for_response( $item, $request );
133
		}
134
135
		$response = rest_ensure_response( $items );
136
		$response->header( 'X-WP-Total', count( $items ) );
137
		$response->header( 'X-WP-TotalPages', 1 );
138
139
		return $response;
140
	}
141
142
	/**
143
	 * Filters out data based on ?_fields= request parameter

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

@@ 72-84 (lines=13) @@
69
	 * @param WP_REST_Request $request
70
	 * @return WP_REST_Response suitable for 1-page collection
71
	 */
72
	public function get_items( $request ) {
73
		$items = array();
74
75
		foreach ( $this->get_connections() as $item ) {
76
			$items[] = $this->prepare_item_for_response( $item, $request );
77
		}
78
79
		$response = rest_ensure_response( $items );
80
		$response->header( 'X-WP-Total', count( $items ) );
81
		$response->header( 'X-WP-TotalPages', 1 );
82
83
		return $response;
84
	}
85
86
	/**
87
	 * Filters out data based on ?_fields= request parameter