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
@@ 993-1007 (lines=15) @@
990
	 *
991
	 * @return bool
992
	 */
993
	public static function is_J2ME_platform() {
994
995
		if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) {
996
			return false;
997
		}
998
999
		$agent = strtolower( $_SERVER['HTTP_USER_AGENT'] );
1000
1001
		if ( strpos( $agent, 'j2me/midp' ) !== false ) {
1002
			return true;
1003
		} elseif ( strpos( $agent, 'midp' ) !== false && strpos( $agent, 'cldc' ) ) {
1004
			return true;
1005
		}
1006
		return false;
1007
	}
1008
1009
	/**
1010
	 * Detects if the current UA is on one of the Maemo-based Nokia Internet Tablets.