Code Duplication    Length = 12-13 lines in 2 locations

lib/private/User/SyncService.php 2 locations

@@ 247-258 (lines=12) @@
244
		}
245
	}
246
247
	private function syncDisplayName(Account $a, UserInterface $backend) {
248
		$uid = $a->getUserId();
249
		if ($backend instanceof IProvidesDisplayNameBackend || $backend->implementsActions(\OC_User_Backend::GET_DISPLAYNAME)) {
250
			$displayName = $backend->getDisplayName($uid);
251
			$a->setDisplayName($displayName);
252
			if (array_key_exists('displayName', $a->getUpdatedFields())) {
253
				$this->logger->debug(
254
					"Setting displayName for <$uid> to <$displayName>", ['app' => self::class]
255
				);
256
			}
257
		}
258
	}
259
260
	private function syncSearchTerms(Account $a, UserInterface $backend) {
261
		$uid = $a->getUserId();
@@ 260-272 (lines=13) @@
257
		}
258
	}
259
260
	private function syncSearchTerms(Account $a, UserInterface $backend) {
261
		$uid = $a->getUserId();
262
		if ($backend instanceof IProvidesExtendedSearchBackend) {
263
			$searchTerms = $backend->getSearchTerms($uid);
264
			$a->setSearchTerms($searchTerms);
265
			if ($a->haveTermsChanged()) {
266
				$logTerms = join('|', $searchTerms);
267
				$this->logger->debug(
268
					"Setting searchTerms for <$uid> to <$logTerms>", ['app' => self::class]
269
				);
270
			}
271
		}
272
	}
273
274
	/**
275
	 * @param Account $a