Code Duplication    Length = 7-7 lines in 2 locations

lib/BackgroundJob/Tasks/AddMissingImagesTask.php 1 location

@@ 86-92 (lines=7) @@
83
84
		// Check if we are called for one user only, or for all user in instance.
85
		$eligable_users = array();
86
		if (is_null($this->context->user)) {
87
			$this->context->userManager->callForSeenUsers(function (IUser $user) use (&$eligable_users) {
88
				$eligable_users[] = $user->getUID();
89
			});
90
		} else {
91
			$eligable_users[] = $this->context->user->getUID();
92
		}
93
94
		foreach($eligable_users as $user) {
95
			$this->addMissingImagesForUser($user, $model);

lib/BackgroundJob/Tasks/CreateClustersTask.php 1 location

@@ 93-99 (lines=7) @@
90
		// However, since we don't want to do deep copy of IUser, we keep only UID in this array.
91
		//
92
		$eligable_users = array();
93
		if (is_null($this->context->user)) {
94
			$this->context->userManager->callForSeenUsers(function (IUser $user) use (&$eligable_users) {
95
				$eligable_users[] = $user->getUID();
96
			});
97
		} else {
98
			$eligable_users[] = $this->context->user->getUID();
99
		}
100
101
		foreach($eligable_users as $user) {
102
			$this->createClusterIfNeeded($user);