Code Duplication    Length = 5-6 lines in 2 locations

api/src/Mail.php 2 locations

@@ 2530-2534 (lines=5) @@
2527
		// always use static on single request if info is available;
2528
		// so if you require subscribed/unsubscribed results on a single request you MUST
2529
		// set $_useCacheIfPossible to false !
2530
		if ($_useCacheIfPossible && isset($folders2return[$this->icServer->ImapServerId]) && !empty($folders2return[$this->icServer->ImapServerId]))
2531
		{
2532
			if (self::$debugTimes) self::logRunTimes($starttime,null,'using static',__METHOD__.' ('.__LINE__.') ');
2533
			return $folders2return[$this->icServer->ImapServerId];
2534
		}
2535
2536
		if ($_subscribedOnly && $_getCounters===false)
2537
		{
@@ 2539-2544 (lines=6) @@
2536
		if ($_subscribedOnly && $_getCounters===false)
2537
		{
2538
			if (is_null($folders2return)) $folders2return = Cache::getCache(Cache::INSTANCE,'email','folderObjects'.trim($GLOBALS['egw_info']['user']['account_id']),null,array(),60*60*1);
2539
			if ($_useCacheIfPossible && isset($folders2return[$this->icServer->ImapServerId]) && !empty($folders2return[$this->icServer->ImapServerId]))
2540
			{
2541
				//error_log(__METHOD__.' ('.__LINE__.') '.' using Cached folderObjects'.array2string($folders2return[$this->icServer->ImapServerId]));
2542
				if (self::$debugTimes) self::logRunTimes($starttime,null,'from Cache',__METHOD__.' ('.__LINE__.') ');
2543
				return $folders2return[$this->icServer->ImapServerId];
2544
			}
2545
		}
2546
		// use $folderBasicInfo for holding attributes and other basic folderinfo $folderBasicInfo[$this->icServer->ImapServerId]
2547
		static $folderBasicInfo;