Code Duplication    Length = 25-25 lines in 2 locations

src/IPub/MobileDetect/Events/OnRequestHandler.php 2 locations

@@ 199-223 (lines=25) @@
196
	 *
197
	 * @return bool
198
	 */
199
	private function hasPhoneRedirect() : bool
200
	{
201
		if (!$this->redirectConf['phone']['isEnabled']) {
202
			return FALSE;
203
		}
204
205
		$isPhone = $this->mobileDetect->isPhone();
206
207
		if ($this->redirectConf['detectPhoneAsMobile'] === FALSE) {
208
			$isPhoneHost = ($this->getCurrentHost() === $this->redirectConf['phone']['host']);
209
210
			if ($isPhone && !$isPhoneHost && ($this->getRoutingOption(self::PHONE) != self::NO_REDIRECT)) {
211
				return TRUE;
212
			}
213
214
		} else {
215
			$isMobileHost = ($this->getCurrentHost() === $this->redirectConf['mobile']['host']);
216
217
			if ($isPhone && !$isMobileHost && ($this->getRoutingOption(self::PHONE) != self::NO_REDIRECT)) {
218
				return TRUE;
219
			}
220
		}
221
222
		return FALSE;
223
	}
224
225
	/**
226
	 * Detects tablet redirections
@@ 230-254 (lines=25) @@
227
	 *
228
	 * @return bool
229
	 */
230
	private function hasTabletRedirect() : bool
231
	{
232
		if (!$this->redirectConf['tablet']['isEnabled']) {
233
			return FALSE;
234
		}
235
236
		$isTablet = $this->mobileDetect->isTablet();
237
238
		if ($this->redirectConf['detectTabletAsMobile'] === FALSE) {
239
			$isTabletHost = ($this->getCurrentHost() === $this->redirectConf['tablet']['host']);
240
241
			if ($isTablet && !$isTabletHost && ($this->getRoutingOption(self::TABLET) != self::NO_REDIRECT)) {
242
				return TRUE;
243
			}
244
245
		} else {
246
			$isMobileHost = ($this->getCurrentHost() === $this->redirectConf['mobile']['host']);
247
248
			if ($isTablet && !$isMobileHost && ($this->getRoutingOption(self::TABLET) != self::NO_REDIRECT)) {
249
				return TRUE;
250
			}
251
		}
252
253
		return FALSE;
254
	}
255
256
	/**
257
	 * Detects mobile redirections