Code Duplication    Length = 12-13 lines in 2 locations

lib/private/User/SyncService.php 2 locations

@@ 284-295 (lines=12) @@
281
	 * @param Account $a
282
	 * @param UserInterface $backend
283
	 */
284
	private function syncDisplayName(Account $a, UserInterface $backend) {
285
		$uid = $a->getUserId();
286
		if ($backend instanceof IProvidesDisplayNameBackend || $backend->implementsActions(\OC_User_Backend::GET_DISPLAYNAME)) {
287
			$displayName = $backend->getDisplayName($uid);
288
			$a->setDisplayName($displayName);
289
			if (\array_key_exists('displayName', $a->getUpdatedFields())) {
290
				$this->logger->debug(
291
					"Setting displayName for <$uid> to <$displayName>", ['app' => self::class]
292
				);
293
			}
294
		}
295
	}
296
297
	/**
298
	 * TODO store username in account table instead of user preferences
@@ 325-337 (lines=13) @@
322
	 * @param Account $a
323
	 * @param UserInterface $backend
324
	 */
325
	private function syncSearchTerms(Account $a, UserInterface $backend) {
326
		$uid = $a->getUserId();
327
		if ($backend instanceof IProvidesExtendedSearchBackend) {
328
			$searchTerms = $backend->getSearchTerms($uid);
329
			$a->setSearchTerms($searchTerms);
330
			if ($a->haveTermsChanged()) {
331
				$logTerms = \implode('|', $searchTerms);
332
				$this->logger->debug(
333
					"Setting searchTerms for <$uid> to <$logTerms>", ['app' => self::class]
334
				);
335
			}
336
		}
337
	}
338
339
	/**
340
	 * @param Account $a