Code Duplication    Length = 5-5 lines in 4 locations

api/src/Mail.php 4 locations

@@ 526-530 (lines=5) @@
523
		{
524
			self::resetConnectionErrorCache($_profileID);
525
			$rawHeadersCache = Cache::getCache(Cache::INSTANCE,'email','rawHeadersCache'.trim($account_id),$callback=null,$callback_params=array(),$expiration=60*60*1);
526
			if (isset($rawHeadersCache[$_profileID]))
527
			{
528
				unset($rawHeadersCache[$_profileID]);
529
				Cache::setCache(Cache::INSTANCE,'email','rawHeadersCache'.trim($account_id),$rawHeadersCache, $expiration=60*60*1);
530
			}
531
			$HierarchyDelimiterCache = Cache::getCache(Cache::INSTANCE,'email','HierarchyDelimiter'.trim($account_id),$callback=null,$callback_params=array(),$expiration=60*60*24*5);
532
			if (isset($HierarchyDelimiterCache[$_profileID]))
533
			{
@@ 532-536 (lines=5) @@
529
				Cache::setCache(Cache::INSTANCE,'email','rawHeadersCache'.trim($account_id),$rawHeadersCache, $expiration=60*60*1);
530
			}
531
			$HierarchyDelimiterCache = Cache::getCache(Cache::INSTANCE,'email','HierarchyDelimiter'.trim($account_id),$callback=null,$callback_params=array(),$expiration=60*60*24*5);
532
			if (isset($HierarchyDelimiterCache[$_profileID]))
533
			{
534
				unset($HierarchyDelimiterCache[$_profileID]);
535
				Cache::setCache(Cache::INSTANCE,'email','HierarchyDelimiter'.trim($account_id),$HierarchyDelimiterCache, $expiration=60*60*24*5);
536
			}
537
			//reset folderObject cache, to trigger reload
538
			self::resetFolderObjectCache($_profileID);
539
			//reset counter of deleted messages per folder
@@ 541-545 (lines=5) @@
538
			self::resetFolderObjectCache($_profileID);
539
			//reset counter of deleted messages per folder
540
			$eMailListContainsDeletedMessages = Cache::getCache(Cache::INSTANCE,'email','eMailListContainsDeletedMessages'.trim($account_id),$callback=null,$callback_params=array(),$expiration=60*60*1);
541
			if (isset($eMailListContainsDeletedMessages[$_profileID]))
542
			{
543
				unset($eMailListContainsDeletedMessages[$_profileID]);
544
				Cache::setCache(Cache::INSTANCE,'email','eMailListContainsDeletedMessages'.trim($account_id),$eMailListContainsDeletedMessages, $expiration=60*60*1);
545
			}
546
			$vacationCached = Cache::getCache(Cache::INSTANCE, 'email', 'vacationNotice'.trim($account_id),$callback=null,$callback_params=array(),$expiration=60*60*24*1);
547
			if (isset($vacationCached[$_profileID]))
548
			{
@@ 547-551 (lines=5) @@
544
				Cache::setCache(Cache::INSTANCE,'email','eMailListContainsDeletedMessages'.trim($account_id),$eMailListContainsDeletedMessages, $expiration=60*60*1);
545
			}
546
			$vacationCached = Cache::getCache(Cache::INSTANCE, 'email', 'vacationNotice'.trim($account_id),$callback=null,$callback_params=array(),$expiration=60*60*24*1);
547
			if (isset($vacationCached[$_profileID]))
548
			{
549
				unset($vacationCached[$_profileID]);
550
				Cache::setCache(Cache::INSTANCE,'email','vacationNotice'.trim($account_id),$vacationCached, $expiration=60*60*24*1);
551
			}
552
553
			if (isset(self::$instances[$_profileID])) unset(self::$instances[$_profileID]);
554
		}