Code Duplication    Length = 15-15 lines in 2 locations

classes/class-wetu-importer-accommodation.php 1 location

@@ 358-372 (lines=15) @@
355
356
								$searched_items[ sanitize_title( $row['name'] ) . '-' . $row['id'] ] = $this->format_row( $row );
357
							}
358
						} else {
359
							//Search through each keyword.
360
							foreach ( $keyphrases as $keyphrase ) {
361
								//Make sure the keyphrase is turned into an array
362
								$keywords = explode( ' ',$keyphrase );
363
364
								if ( ! is_array( $keywords ) ) {
365
									$keywords = array( $keywords );
366
								}
367
368
								if ( $this->multineedle_stripos( ltrim( rtrim( $row['name'] ) ), $keywords ) !== false ) {
369
									$searched_items[ sanitize_title( $row['name'] ) . '-' . $row['id'] ] = $this->format_row( $row );
370
								}
371
							}
372
						}
373
					}
374
				}
375

classes/class-wetu-importer-tours.php 1 location

@@ 449-463 (lines=15) @@
446
447
								$searched_items[ sanitize_title( $row['name'] ) . '-' . $row['identifier'] ] = $this->format_row( $row );
448
							}
449
						} else {
450
							//Search through each keyword.
451
							foreach ( $keyphrases as $keyphrase ) {
452
453
								//Make sure the keyphrase is turned into an array
454
								$keywords = explode( ' ',$keyphrase );
455
								if ( ! is_array( $keywords ) ) {
456
									$keywords = array( $keywords );
457
								}
458
459
								if ( $this->multineedle_stripos( ltrim( rtrim( $row['name'] ) ), $keywords ) !== false ) {
460
									$searched_items[ sanitize_title( $row['name'] ) . '-' . $row['identifier'] ] = $this->format_row( $row );
461
								}
462
							}
463
						}
464
					}
465
				}
466