Code Duplication    Length = 14-15 lines in 2 locations

projects/packages/device-detection/src/class-user-agent-info.php 2 locations

@@ 674-687 (lines=14) @@
671
	 * Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion
672
	 * The platform section will include 'Mobile' for phones and 'Tablet' for tablets.
673
	 */
674
	public static function is_firefox_desktop() {
675
676
		if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) {
677
			return false;
678
		}
679
680
		$ua = strtolower( $_SERVER['HTTP_USER_AGENT'] );
681
682
		if ( false !== strpos( $ua, 'firefox' ) && false === strpos( $ua, 'mobile' ) && false === strpos( $ua, 'tablet' ) ) {
683
			return true;
684
		} else {
685
			return false;
686
		}
687
	}
688
689
	/**
690
	 * Detects if the current browser is FirefoxOS Native browser
@@ 985-999 (lines=15) @@
982
	 *
983
	 * @return bool
984
	 */
985
	public static function is_J2ME_platform() {
986
987
		if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) {
988
			return false;
989
		}
990
991
		$agent = strtolower( $_SERVER['HTTP_USER_AGENT'] );
992
993
		if ( strpos( $agent, 'j2me/midp' ) !== false ) {
994
			return true;
995
		} elseif ( strpos( $agent, 'midp' ) !== false && strpos( $agent, 'cldc' ) ) {
996
			return true;
997
		}
998
		return false;
999
	}
1000
1001
	/**
1002
	 * Detects if the current UA is on one of the Maemo-based Nokia Internet Tablets.