Code Duplication    Length = 8-8 lines in 2 locations

src/includes/class-wordlift-relation-service.php 2 locations

@@ 293-300 (lines=8) @@
290
	 *
291
	 * @return string An empty string if $status is null, otherwise the status clause.
292
	 */
293
	private static function and_status( $status = null ) {
294
295
		if ( null === $status ) {
296
			return '';
297
		}
298
299
		return " AND p.post_status IN ('" . implode( "', '", array_map( 'esc_sql', (array) $status ) ) . "')";
300
	}
301
302
	/**
303
	 * Add the `predicate` clause.
@@ 312-319 (lines=8) @@
309
	 * @return string An empty string if $predicate is null otherwise the predicate
310
	 *                clause.
311
	 */
312
	private static function and_predicate( $predicate = null ) {
313
314
		if ( null === $predicate ) {
315
			return '';
316
		}
317
318
		return " AND r.predicate IN ('" . implode( "', '", array_map( 'esc_sql', (array) $predicate ) ) . "')";
319
	}
320
321
	/**
322
	 * The select fields.