Code Duplication    Length = 2-5 lines in 5 locations

Sources/Class-BrowserDetect.php 5 locations

@@ 255-259 (lines=5) @@
252
		$this->_browsers['is_ipad'] = strpos($_SERVER['HTTP_USER_AGENT'], 'iPad') !== false;
253
254
		// if Chrome, get the major version
255
		if ($this->_browsers['is_chrome'])
256
		{
257
			if (preg_match('~chrome[/]([0-9][0-9]?[.])~i', $_SERVER['HTTP_USER_AGENT'], $match) === 1)
258
				$this->_browsers['is_chrome' . (int) $match[1]] = true;
259
		}
260
261
		// or if Safari get its major version
262
		if ($this->_browsers['is_safari'])
@@ 262-266 (lines=5) @@
259
		}
260
261
		// or if Safari get its major version
262
		if ($this->_browsers['is_safari'])
263
		{
264
			if (preg_match('~version/?(.*)safari.*~i', $_SERVER['HTTP_USER_AGENT'], $match) === 1)
265
				$this->_browsers['is_safari' . (int) trim($match[1])] = true;
266
		}
267
	}
268
269
	/**
@@ 329-330 (lines=2) @@
326
	 */
327
	private function setupFirefox()
328
	{
329
		if (preg_match('~(?:Firefox|Ice[wW]easel|IceCat|Shiretoko|Minefield)[\/ \(]([^ ;\)]+)~', $_SERVER['HTTP_USER_AGENT'], $match) === 1)
330
			$this->_browsers['is_firefox' . (int) $match[1]] = true;
331
	}
332
333
	/**
@@ 344-345 (lines=2) @@
341
		if (preg_match('~\sVersion/([0-9]+)\.[0-9]+(?:\s*|$)~', $_SERVER['HTTP_USER_AGENT'], $match))
342
			$this->_browsers['is_opera' . (int) $match[1]] = true;
343
		// Opera pre 10 is supposed to uses the Opera tag alone, as do some spoofers
344
		elseif (preg_match('~Opera[ /]([0-9]+)(?!\\.[89])~', $_SERVER['HTTP_USER_AGENT'], $match))
345
			$this->_browsers['is_opera' . (int) $match[1]] = true;
346
347
		// Needs size fix?
348
		$this->_browsers['needs_size_fix'] = !empty($this->_browsers['is_opera6']);
@@ 356-357 (lines=2) @@
353
	 */
354
	private function setupEdge()
355
	{
356
		if (preg_match('~Edge[\/]([0-9][0-9]?[\.][0-9][0-9])~i', $_SERVER['HTTP_USER_AGENT'], $match) === 1)
357
			$this->_browsers['is_edge' . (int) $match[1]] = true;
358
	}
359
360
	/**