Code Duplication    Length = 11-13 lines in 2 locations

src/admin/class-wordlift-admin-dashboard.php 1 location

@@ 268-278 (lines=11) @@
265
		return (int) false;
266
	}
267
268
	private function rl_sparql_select( $query ) {
269
270
		// Prepare the SPARQL statement by prepending the default namespaces.
271
		$sparql = rl_sparql_prefixes() . "\n" . $query;
272
		// Get the SPARQL SELECT URL.
273
		$url = wl_configuration_get_query_select_url( 'csv' ) . urlencode( $sparql );
274
		// Prepare the request.
275
		$args = unserialize( WL_REDLINK_API_HTTP_OPTIONS );
276
277
		return wp_remote_get( $url, $args );
278
	}
279
280
	private function render_stat_param( $param ) {
281

src/includes/class-wordlift-sparql-service.php 1 location

@@ 168-180 (lines=13) @@
165
	 *
166
	 * @return WP_Error|array The response or WP_Error on failure.
167
	 */
168
	public function select( $query ) {
169
170
		// Prepare the SPARQL statement by prepending the default namespaces.
171
		$sparql = rl_sparql_prefixes() . "\n" . $query;
172
173
		// Get the SPARQL SELECT URL.
174
		$url = wl_configuration_get_query_select_url( 'csv' ) . urlencode( $sparql );
175
176
		// Prepare the request.
177
		$args = unserialize( WL_REDLINK_API_HTTP_OPTIONS );
178
179
		return wp_remote_get( $url, $args );
180
	}
181
182
	/**
183
	 * Formats the provided value according to the specified type in order to