Code Duplication    Length = 12-13 lines in 2 locations

lib/private/User/SyncService.php 2 locations

@@ 263-274 (lines=12) @@
260
	 * @param Account $a
261
	 * @param UserInterface $backend
262
	 */
263
	private function syncDisplayName(Account $a, UserInterface $backend) {
264
		$uid = $a->getUserId();
265
		if ($backend instanceof IProvidesDisplayNameBackend || $backend->implementsActions(\OC_User_Backend::GET_DISPLAYNAME)) {
266
			$displayName = $backend->getDisplayName($uid);
267
			$a->setDisplayName($displayName);
268
			if (array_key_exists('displayName', $a->getUpdatedFields())) {
269
				$this->logger->debug(
270
					"Setting displayName for <$uid> to <$displayName>", ['app' => self::class]
271
				);
272
			}
273
		}
274
	}
275
276
	/**
277
	 * @param Account $a
@@ 280-292 (lines=13) @@
277
	 * @param Account $a
278
	 * @param UserInterface $backend
279
	 */
280
	private function syncSearchTerms(Account $a, UserInterface $backend) {
281
		$uid = $a->getUserId();
282
		if ($backend instanceof IProvidesExtendedSearchBackend) {
283
			$searchTerms = $backend->getSearchTerms($uid);
284
			$a->setSearchTerms($searchTerms);
285
			if ($a->haveTermsChanged()) {
286
				$logTerms = join('|', $searchTerms);
287
				$this->logger->debug(
288
					"Setting searchTerms for <$uid> to <$logTerms>", ['app' => self::class]
289
				);
290
			}
291
		}
292
	}
293
294
	/**
295
	 * @param Account $a